Inserting text into cell bound to an integer column in GDBG

Hi, I have a GDBG which has been bound to a DataTable. One of the columns is an integer column. Depending on the value in this integer column, I want to set the text in the corresponding cell. But in the PrepareViewStyleInfo for the GDBG, if I set the e.Style.Text property to "NA" if it was 0, then "Input string was not in correct format" gets displayed in the cell. Is there any other way of doing this i.e. inserting text into a cell that has been mapped to a number column? Thanks

1 Reply

AD Administrator Syncfusion Team September 9, 2005 10:07 AM UTC

Hi Atith, Try handling DrawCellDisplayText event and set e.DisplayText. private void gridDataBoundGrid2_DrawCellDisplayText(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs e) { if(e.Style.CellIdentity.ColIndex==1 && e.Style.CellIdentity.RowIndex>0 ) { e.DisplayText="Hi"; } } Here is a sample: mappingname.zip Regards, Jeba.

Loader.
Up arrow icon