I have DataBoundGrid binded to table in DataSet. I am adding unbound column to GridBoundColumns collection. When I''m trying to set value to the cell in unbound column - the cell remains empty.
int unboundColIdx = 2;
gridDataBoundGrid1[1,unboundColIdx].Text = "aaa";
What I have to do in order to display constant values in unbound column?
ADAdministrator Syncfusion Team December 17, 2003 08:08 AM
You would need to handle the grid.Model.QueryCellInfo event and if e.ColIndex points to your unbound column and e.RowIndex > 0, then set e.Style.Text to the value you want to see for this row.
GSGreg ShometteJanuary 23, 2004 04:37 PM
Is there an other event that I can use instead of QueryCellInfo. When I use QueryCellInfo event everytime I touch the grid it fires, I need to enter a value in my qty column and after the value changes in the qty column I would like to have a unbound calculated column.
ADAdministrator Syncfusion Team January 23, 2004 05:34 PM
QueryCellInfo is the place you need to do this. The event is fired everytime something needs teh value of a cell. You should use e.ColIndex and e.RowIndex to control exactly when you hit your code to provide the value for your unbound column.
You could store the calculations in some structure like an array or arraylist or hashtable, and do the calculations and store the calculated values into your structure in a CuurentCellAcceptedChanges event (for example). Buy you still will have to handle QueryCellInfo to provide the values from your structure when the QueryCellInfo requests one of your unbound columns.
CHchinniFebruary 5, 2004 09:44 PM
Where do i find this event grid.Model.QueryCellInfo event can anyone send me an example of this
ADAdministrator Syncfusion Team February 6, 2004 02:50 AM
Do a ''Find in Files'' on QueryCellInfo in the Syncfusion\Essential Suite\Grid\Samples folder and you will get 80 or 90 hits for samples uses of this event.
If you are using it in a GridDataBoundgrid, try the Grid\Samples\DataBound\GDBGMultiHeader sample.
The virtual grid tutorials are another straight-forward example, but it is based on a GridCotrol. But the idea is the same.