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

GridControl CheckBoxClick invoked twice

Hi, I have a Gridcontrol and one of my columns is populated with checkbox (defined using a gridRangeStyle.StyleInfo.CellType = "CheckBox"). I''ve setup both the event handlers (CheckBoxClick and CellsChanged) on the Gridcontrol. Both these event handlers are invoked twice whenever the checkbox is clicked. Is this the normal behaviour? I''d expect the event handlers to be invoked once. This is causing a work around to be written in my code. Please advise. Thanks, Sanjit

4 Replies

SR Sanjit Roy February 2, 2006 03:52 PM UTC

I''d missed out to mention that i''m using Syncfusion Essential Studio 4.1.0.50 and Visual Studio 2003.


ST stanleyj Syncfusion Team February 2, 2006 04:10 PM UTC

Hi Sanjit, These events are raised only once in this sample. Please let me know if you find issues. Best regards, Stanley


SR Sanjit Roy February 2, 2006 04:54 PM UTC

Stanley, Thanks for your prompt response. The sample you provided does invoke the CheckBoxClick once. The only difference i see between the two codes is that in your code, the checkbox cell is defined using a GridCellInfo object and then setting the gridCellInfo1.StyleInfo.CellType = "CheckBox"; On the other hand, the checkbox is defined in my code using the following snippet of code: Syncfusion.Windows.Forms.Grid.GridRangeStyle gridRangeStyle = new Syncfusion.Windows.Forms.Grid.GridRangeStyle(); gridRangeStyle.Range = Syncfusion.Windows.Forms.Grid.GridRangeInfo.Cell(2, 1); gridRangeStyle.StyleInfo.CellType = "CheckBox"; gridRangeStyle.StyleInfo.Tag = "checkBox1"; gridRangeStyle.StyleInfo.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Center; // Add the RangeStyle to the GridControl gridControl.RangeStyles.Add(gridRangeStyle); I''d assume that both ways of implementing the checkbox on the GridControl is valid.


SR Sanjit Roy February 2, 2006 05:51 PM UTC

Stanley, I think i figured out what the problem was. It had to do with implementing the eventhandling in another objects method, which had the GridControl passed to it as parameter. I was able to modify your sample to use the gridRangeStyle approach i had in my code and noticed that it does gets invoked once. I''ve modified my code appropriately and it behaves correctly now. Thank you for your help and in providing me with the sample. Regards, Sanjit

Loader.
Live Chat Icon For mobile
Up arrow icon