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

DataBoundGrid, Changing cell properties

I'm trying to change individual cell's properties in DataBoundGrid by using: Grid(Row,Column).Tag=TagValue But it seems not work. How I've to do, to change individual cell's properties?. Is not this possible? Thank you.

1 Reply

AD Administrator Syncfusion Team April 2, 2003 08:21 AM UTC

In a GridDataBoundGrid, you cannot use indexers to set style properties (other than the Text or CellValue) for individual cells. The reason is that in a GridDataBoundGrid, there are no individual cell styles stored. The only datastore for the individual cells in the bound datasource, and it only has the CellValue available. Thus, you can set CellValue using indexers, but nothing else. For a GridControl, this is not a problem (unless you are using the GridControl virtually), but it is with a GridDataboundGrid. If you want to provide Tag objects on individual cells in a GridDataBoundGrid, then you would have to create some data store (HashTable, ArrayList, ???) to hold these objects basaed on row/col. Then you could handle GridDataBoundGrid.Model.QueryCellInfo, and in your handler set e.Style.Tag based on the values of e.RowIndex and e.ColIndex.

Loader.
Live Chat Icon For mobile
Up arrow icon