SK
suresh kumar
October 13, 2005 03:38 PM UTC
con.Open();
ad=new SqlDataAdapter(sr,con);
ds=new DataSet("suresh");
ad.Fill(ds,"suresh");
for(int i=0;i<=ds.Tables["suresh"].Columns.Count-1;i++)
{
this.gridControl1[0,i+1].Text = ds.Tables["suresh"].Columns[i].ColumnName.ToString();
this.gridControl1[0,i+1].Font.Bold = true;
}
for(int i=0;i<=ds.Tables["suresh"].Rows.Count-1;i++)
{
for(int j=0;j<=ds.Tables["suresh"].Columns.Count-1;j++)
{
this.gridControl1[i+1,j+1].Text =ds.Tables["suresh"].Rows[i].ItemArray.GetValue(j).ToString();
this.gridControl1[i+1,j+1].Font.Bold = true;
}
}
con.Close();
AD
Administrator
Syncfusion Team
October 13, 2005 04:18 PM UTC
To use a GridDataBoundGrid, your entity object would have to be some kind of IList.
You can use a GridControl in virtual mode to bind to anything. In virtual mode, the grid raises an event (QueryCellInfo) when it wants data for a given row, col. And in your event handler, you could provide the data from wherever you wanted to get it, including calling methods on objects. Now, you would want such methods to be very efficient as QueryCellInfo is raised constantly, many, many, many times. Check the grid''s User Guide for information on virtual grids.