How to show two properties in one column of GRid View asp.net C#

后端 未结 2 1541
春和景丽
春和景丽 2021-01-24 13:44

I have class Person, having two properties First Name and Last Name, if I set array of person as Data Source to GridView how can I show both First Name and Last Name in one colu

2条回答
  •  囚心锁ツ
    2021-01-24 14:36

    Use tempate field and Eval method:

           
               
                 
                   
            <%# Eval("FirstName") %> <%# Eval("LastName") %>
                   
             
       
    
    

提交回复
热议问题