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

Which event?

ES 2.0.6.0 I have a GDBG and I want to change the display text of a column based on the value of a non-displayed column in the same row. Which event will allow me to do this? Sean

5 Replies

AD Administrator Syncfusion Team July 11, 2004 06:32 PM UTC

You can try PrepareViewStyleInfo. If e.ColIndex points to the column you want to format, then set e.Style.Text to whatever you want to see.


SG Sean Greer July 11, 2004 06:56 PM UTC

That got me half way there. When the grid intially renders the value that is displayed is the value that I provided via PVSI. However, then I click on the cell I see the actual underlying value and not the value provided by PVSI. The cell type is Static. Any thoughts?


AD Administrator Syncfusion Team July 11, 2004 09:25 PM UTC

To handle setting the text when the cell becomes current, you can subcribe to CurrentCellInitializeControlText and do the work there setting e.ControlText toyour desired text and also setting e.Cancel = true so the grid will not reset things.


AD Administrator Syncfusion Team July 12, 2004 05:06 AM UTC

You can do it using a single event in grid.Model.QueryCellInfo using code similar to what you put in PrepareViewStyleInfo. (If you are trying to change cell 1,1, and if you subscribe to the event AFTER you set the DataSource of the grid, then you will have to do something like call this.gridDataBoundGrid1.CurrentCell.ResetCurrentCellWithoutDeactivate() to reset the current cell so its value can be modified through QueryCellInfo since it was already set when you set the DataSource. You can make this call right after you subscribe to teh event).


SG Sean Greer July 12, 2004 02:45 PM UTC

Works beautifully! Thanks, Clay.

Loader.
Live Chat Icon For mobile
Up arrow icon