gridview databind

Posted by frenchie on Stack Overflow See other posts from Stack Overflow or by frenchie
Published on 2011-01-15T00:33:38Z Indexed on 2011/01/15 0:53 UTC
Read the original article Hit count: 199

Filed under:

Hi,

I'm doing a gridview with an object datasource:

List<MyObject> TheSource = a linq query

At some point, I have

MyGridview.DataSource = TheSource;
MyGridview.Databind();

and an OnRowDataBound event handler that's tied to the databinding.

In that event handler, how do you make column 2 contain 2 objects from TheSource. For instance, in the TheSource, there is a variable for FirstName and another one for LastName. Column 2 needs to contain both the first and last name in the same cell.

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET