If i have columns firstname and lastname. How can I combine them to include just one column called 'Name' with data from firstname and lastname like' lastname,firstname'.
Hello dev_here,
If you have any further questions, please feel free to contact me.
Hi dev_here,
A possible approach would be to hide one of the columns, for example LastName. Then on InitializeRow event, get the text from that column and append it to the FirstName column’s text:
protected void WebDataGrid1_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e)
{
string lastName = e.Row.Items.FindItemByKey("LastName").Text;
string firstName = e.Row.Items.FindItemByKey("FirstName").Text;
e.Row.Items.FindItemByKey("FirstName").Text = lastName + ", " + firstName;
}
You could also consider using multi column headers - http://ko.infragistics.com/products/aspnet/sample/data-grid/multi-column-headers, http://ko.infragistics.com/community/blogs/jordan_tsankov/archive/2012/03/26/implementing-multi-column-headers-in-webdatagrid.aspx.
Hope this helps.