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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Which event?

Thread ID:





16288 Jul 11,2004 04:27 PM UTC Jul 12,2004 02:45 PM UTC WinForms 5
Tags: GridControl
Sean Greer
Asked On July 11, 2004 04:27 PM UTC

ES 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

Administrator [Syncfusion]
Replied On 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.

Sean Greer
Replied On 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?

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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).

Sean Greer
Replied On July 12, 2004 02:45 PM UTC

Works beautifully! Thanks, Clay.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon