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
close icon

Unbound column in DataBoundGrid

Hi, 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? Thanks, Alex.

5 Replies

AD Administrator Syncfusion Team December 17, 2003 01:08 PM UTC

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.


GS Greg Shomette January 23, 2004 09:37 PM UTC

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. Thanks


AD Administrator Syncfusion Team January 23, 2004 10:34 PM UTC

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.


CH chinni February 6, 2004 02:44 AM UTC

Where do i find this event grid.Model.QueryCellInfo event can anyone send me an example of this


AD Administrator Syncfusion Team February 6, 2004 07:50 AM UTC

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.

Loader.
Live Chat Icon For mobile
Up arrow icon