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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Sort on ComboBox DisplayMember in GridGroupingControl

Thread ID:





39048 Dec 23,2005 03:34 PM UTC Jan 23,2006 01:05 PM UTC WinForms 7
Tags: GridControl
Asked On December 23, 2005 03:34 PM UTC

One of my columns in a GridGroupingControl is a ComboBox which is populated from a lookup table. I want the GGC column sorted by the DisplayMember of the comboBox rather than the ValueMembers. Thanks, Van Baker

Administrator [Syncfusion]
Replied On December 23, 2005 05:22 PM UTC

Hi Van Baker, Please refer this sample that shows how to get this working. http://www.syncfusion.com/Support/user/uploads/GGC_ForeignKeyReference_a924c4a.zip Best regards, Jay

Replied On December 23, 2005 07:00 PM UTC

Thanks, Jay. That is exactly what I needed. I had seen a similar example on Foreign Keys, but was not able to quite follow how it worked. But your example solved my problem. Merry Christmas! --Van Baker

Administrator [Syncfusion]
Replied On January 19, 2006 05:38 AM UTC

hi, This solution successfully worked for me also. But the problem is that, the drop down now is different from the way it looked earlier. The difference is the drop down has a column header now , earlier it didnt have. I also dont want borders around the cells in the drop dowm, how to do it? regards, catinat

Administrator [Syncfusion]
Replied On January 19, 2006 07:15 AM UTC

hi, I am able to remove the borders using queryce;;styleinfo event, but how to remove the header. I am adding two pic files showing the differrence. regards, catinat


stanleyj [Syncfusion]
Replied On January 20, 2006 12:07 AM UTC

Hi Catinat, The column header can be removed through the TopLevelGroupOptions in the TableDescriptor. GridRelationDescriptor rd = new GridRelationDescriptor(); rd.ChildTableDescriptor.TopLevelGroupOptions.ShowColumnHeaders = false; Best regards, Stanley

Administrator [Syncfusion]
Replied On January 23, 2006 06:11 AM UTC

hi, Given a record, say GridRecord , I want to access the relation columns value, if I use record.GetValue(), I am not able to get the value. Say my parent tabledescriptor has the column called ID and child tabledescriptor has LOOK_UP, and I add a realtion(ID, LOOK_UP) to the parent tabeldescriptor with the primary key, PRIMARY_ID,now given the PRIMARY_ID I need to get the value of relation column, when I use the following code, foreach(GridRecord r in this.grid.Table.Records) { if(r.GetValue("PRIMARY_ID") = 1200) { return r.GetValue("ID") // gives me value of "ID" whereas I want "LOOK_UP } }

Administrator [Syncfusion]
Replied On January 23, 2006 01:05 PM UTC

Hi Catinat, To get a ChildRecord, you need to use the GetRelatedChildTable() method.please try this code foreach(GridRecord r in this.grid.Table.Records) { ChildTable ct = gr.GetRelatedChildTable(new RelationDescriptor("ParentToChild")); if(r.GetValue("PRIMARY_ID") = 1200) { foreach (GridRecord cr in ct.Records ) Console.WriteLine(cr.GetValue("ID")+"---"+cr.GetValue("Name") ); } } Thanks Haneef


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon