DataGridTableStyle for Syncfusion Grid.

Hi,

I have just started working with Syncfusion Grids. In one of my projects I am using the GridDataBoundGrid. I bind an Arraylist of my business Objects to the Grid. By default all the public properties are displayed in the column.

I wanted to know if there is something simmilar to "DataGridTableStyle" for the syncfusion datagrid to control how the properties are displayed in columns.

http://www.akadia.com/services/dotnet_arraylist_datagrid.html

If you could revert to me, that would be great.

Thanks,
Jogesh.

1 Reply

AD Administrator Syncfusion Team May 11, 2007 04:59 PM UTC

In that sample, drop a GridDataBoundGrid on the form next to the DataGrid. Then add a

using Syncfusion.Windows.Forms.Grid;

at the top of the form1.cs file. Then replace the Form.Load with this new Form.Load.

private void DataGridArrayList_Load(object sender, System.EventArgs e)
{
CreateArrayList();
BindArrayListToGrid();

GridBoundColumn gbc = new GridBoundColumn();
gbc.MappingName = "RandomValue";
gbc.HeaderText = "Random Number";
gbc.StyleInfo.Format = "F4";
gbc.StyleInfo.BackColor = Color.Red;
this.gridDataBoundGrid1.GridBoundColumns.Add(gbc);

gbc = new GridBoundColumn();
gbc.MappingName = "SqrtValue";
gbc.HeaderText = "Square Root";
gbc.StyleInfo.Format = "F4";
this.gridDataBoundGrid1.GridBoundColumns.Add(gbc);

this.gridDataBoundGrid1.DataSource = this.arrayList1;
}


You use the GridBoundColumns collection to set the properties on columns in a GridDataBoundGrid.

Loader.
Up arrow icon