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
close icon

How to Sort on ComboBox DisplayMember in GridGroupingControl

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

7 Replies

AD Administrator Syncfusion Team 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


VB vbaker 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


AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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

Diff.zip


ST stanleyj Syncfusion Team 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


AD Administrator Syncfusion Team 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 } }


AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon