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

GridDataBoundGrid CurrentCellChanging event fires irregularly

Thread ID:

Created:

Updated:

Platform:

Replies:

10878 Feb 14,2004 12:46 PM Feb 15,2004 11:14 AM Windows Forms 3
loading
Tags: GridControl
Babu Mannaravalappil
Asked On February 14, 2004 12:46 PM

Hi, It seems that when I change the content of a Dropdown style column or a ColorEdit style column (these are the only two I tested with), first, it fires CurrentCellChanging event twice; the first one has an empty ''ControlText'' property. It fires again immediately and now the ControlText property does have the right value. But then, when I change the contents of the same cell, the event does not fire at all. It only fires again if I change the contents of another cell. I am trying to set the cell value of a ColorEdit control to something like "Color.Yellow" when the user selects the color yellow from the palette. Because, when you select from the palette, it returns the RGB values in numbers and not the name of the color. But if you select from the ''Web'' tab or the ''System'' tab, it returns the name of the color. When I store it to the Cell and the underlying datasource, I want to convert the value consistently either to the color name or the RGB value. Can somebody tell me how to do this please? I hope I explained the whole thing well. Babu.

Administrator [Syncfusion]
Replied On February 14, 2004 05:29 PM

Since not all colors have names, if you want to store teh color as a string, then I think you will probably have to store the r,g,b string containing numbers. Here is a sample that uses CurrentCellCloseDropDown and CurrentCellValidating to manage this. The CurrentCellChanged event does appear to fire twice like you say as the control sets the color empty before its sets it to the chosen color. But I still see the event fired (twice) when I change it a second time. I only see the evnt fired once with the combobox cells. Here is a sample.

Babu Mannaravalappil
Replied On February 15, 2004 11:03 AM

Thanks very much Clay. I will try the sample. Just FYI, I was talking about CurrentCellChanging event and not CurrentCellChanged. I don''t know if that makes any difference because I have not yet tested the CurrentCellChanged event. I wanted to convert the string in the cell before the content is applied on its own. So, I thought the obvious choice would be in the CurrentCellChanging event rather than the CurrentCellChanged event. Thanks again for the prompt help. Babu. >Since not all colors have names, if you want to store teh color as a string, then I think you will probably have to store the r,g,b string containing numbers. Here is a sample that uses CurrentCellCloseDropDown and CurrentCellValidating to manage this. > >The CurrentCellChanged event does appear to fire twice like you say as the control sets the color empty before its sets it to the chosen color. But I still see the event fired (twice) when I change it a second time. I only see the evnt fired once with the combobox cells. > >Here is a sample. > >

Babu Mannaravalappil
Replied On February 15, 2004 11:14 AM

I am sorry I posted the following content as reply to one of my earlier post by mistake. OK. I tried the CurrentCellChanged event and you are right. Though it fires twice, it does fire every time I make changes to the cell even if I am still in the same cell. But the CurrentCellChanging event does not fire if you try the change the value again in the same cell. FYI. Babu.

CONFIRMATION

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.

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.

;