How to add several table columns in one DataGrid Column?
Is there any possibility to diplay several columns of a table in one column of a DataGrid?
eg: I heve a table with the below Columns:
- IDEmployee
- Name
- LastName
- SecondLastName
So, in a DataGrid, in the first column I want to display the ID, and in the second column I want to diplay the complete name (Name, LastName n' SecondLastName)
is it possible?
thanx in advance.
Regards.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

jshepler59 reputationPosted Oct 6, 2004, 7:01 AM EDT
Employee
<%# DataBinder.Eval(Container.Dataitem, "Name") %>
<%# DataBinder.Eval(Container.Dataitem, "LastName") %>
<%# DataBinder.Eval(Container.Dataitem, "SecondLastName") %>
The first method is the preferred way unless you need to have the columns seperate for something else. Having the database doing the work is much more efficient, not to mention easier to code.Carlos SanchezRank #6,113 · 276 reputationPosted Oct 6, 2004, 7:39 AM EDT