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

Foreign keys in GridGorupingControl

How do I display a forgeign value in a GridGroupingControl. This is what I''m trying, and I think it should work, but instead of the string (Name) from the "Foo" table, it just displays the Id (e.g., the values of the column "Type"): GridColumnDescriptor gridcolumndescriptor = new GridColumnDescriptor(); gridcolumndescriptor.Name = "Type"; gridcolumndescriptor.HeaderText = "Foo"; gridcolumndescriptor.MappingName = "Type"; gridcolumndescriptor.ReadOnly = true; gridcolumndescriptor.Width = 120; FooTable foo = dataset.Foo; if(_log.IsDebugEnabled) _log.Debug("Foo contains " + foo.Count); // display s 8 gridcolumndescriptor.Appearance.AnyRecordFieldCell.DataSource = foo; //Also tried "Foo" gridcolumndescriptor.Appearance.AnyRecordFieldCell.ValueMember = "Id"; gridcolumndescriptor.Appearance.AnyRecordFieldCell.DisplayMember = "Name"; itemGrid.TableDescriptor.Columns.Add(gridcolumndescriptor); Thank you, dan

2 Replies

AD Administrator Syncfusion Team August 5, 2004 05:42 AM UTC

Try also setting gridcolumndescriptor.Appearance.AnyRecordFieldCell.CellType = "ComboBox"; If you do not want the see the combo button, set the .ShowButtons property to GridShowButtons.Hide. Another thing to check is "Id" and "Name" are case sensitive, so they need to be exact.


AD Administrator Syncfusion Team August 5, 2004 11:54 AM UTC

Perfect. Thanks.

Loader.
Up arrow icon