How to make Data-Bound Grid show the Component Name for each row?

I am evaluating the Syncfusion data-bound grid. My data to be bound is a list of objects that implement the ICustomTypeDescriptor interface. The properties that they expose get shown in the column headers but the grid ignores the component name returned from ICustomTypeDescriptor.GetComponentName that I would expect to be shown in the row header. How do I get the grid to put each row''s component name in the row headers?

1 Reply

AD Administrator Syncfusion Team December 22, 2005 09:50 AM UTC

Hi NGP, Thanks for evaluating Syncfusion Grid. You can dynamically set the rowheader''s text with the component name by handling the Grid.Model.QueryCellInfo event to see if that helps. this.gridDataBoundGrid1.Model.QueryCellInfo +=new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(Model_QueryCellInfo); private void Model_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e) { if( e.RowIndex > 0 && e.ColIndex == 0 && this.gridDataBoundGrid1.DataSource != null) { BindableObject b = (BindableObject)Books[e.RowIndex - 1]; e.Style.CellType = "Header"; e.Style.Text = TypeDescriptor.GetComponentName(b,true); e.Handled = true; } } Here is a sample. Best regards, Jay

Loader.
Up arrow icon