changing button text at runtime in gdbg

I have a GridDataBoundGrid gdbg with an unbound column of buttons (column 1). How can I change the text on the button at runtime? I have tried gdbg[i,1].Description = "NewText"; but this does not work.
Thanks for any suggestions.

2 Replies

AD Administrator Syncfusion Team January 17, 2007 07:49 PM UTC

Hi Ryan,

By default, DataBoundGrid doesn't store any style info properties. You can not set any cell or row specific properties for the DataBoundGrid other than the CellValue. You need to handle the PrepareViewStyleInfo (or Model.QueryCellInfo) Event to do this. Through this event you can set the style properties for the grid.

To set the Description for a cell, you check for the e.RowIndex/e.ColIndex, if that points to the row you desired, set the e.Style. Description for it.

See the KnowledgeBase Articles for more info.
QueryCellInfo event : http://www.syncfusion.com/Support/article.aspx?id=10351
PrepareViewStyleInfo event :http://www.syncfusion.com/Support/article.aspx?id=560

Please let me know if this helps.
Regards,
Haneef


RY Ryan January 17, 2007 08:50 PM UTC

I added the QueryCellInfo event handler and that worked.
Thanks.

Loader.
Up arrow icon