We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to make two columns''s data display in one GridColumnDescriptor

Thread ID:

Created:

Updated:

Platform:

Replies:

70741 Dec 28,2007 10:01 AM UTC Jan 7,2008 07:19 AM UTC ASP.NET Web Forms (Classic) 2
loading
Tags: Grouping
Sean
Asked On December 28, 2007 10:01 AM UTC

How to make two columns's data display in one GridColumnDescriptor ,I used MappingName="FirstName LastName" but no use.


haneefm [Syncfusion]
Replied On January 4, 2008 07:53 PM UTC

Hi Strife,

You cannot have two columns 's data display in one GridColumnDescriptor .

To do this, you need to add a unbound column with some unique mapping name, say "ID-Name". (At this point, this will just display an empty column in that position in the grid.) To populate this column, add a grid.QueryCellValue event handler. In the handler have code like this.

int RecordIndex =this.gridGroupingControl1.Table.PrimaryKeySortedRecords.IndexOf(e.Record);
if (e.Field.Name == "ID_Name" && RecordIndex >= 0)
{
string s = e.Record.GetValue("Id").ToString() + "-" + e.Record.GetValue("Name").ToString();
e.Value= s;
}

Please refer to the attached sample for implementation and let me know if this helps.
Unboundcolumn.zip

Best regards,
Haneef


Sean
Replied On January 7, 2008 07:19 AM UTC

Hi:
thanks it helps a lot.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;