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.

check box in GridDataBoundGrid

Thread ID:





43465 Apr 24,2006 08:09 AM Apr 25,2006 03:33 AM Windows Forms 4
Tags: GridControl
Fady Sayegh
Asked On April 24, 2006 08:09 AM

hi to all, i''m using the GridDataBoundGrid control, i have a column that contains a checkbox. my GridDataBoundGrid populates correctly (check boxes included). the problem is when i click with the mouse to change the state of the check box of a cell, nothing happend. but if i move to the cell and hit the space bar than the state of the check box change. does someone has a solution for this ? best regards and thanks in advance fady

Administrator [Syncfusion]
Replied On April 24, 2006 08:33 AM

Hi Fady, I have tested this issue by creating a sample using GridDatabound in v. and then again tested by upgrading to I was not able to reproduce the issue. Here is a sample http://www.syncfusion.com/Support/user/uploads/DataBoundGrid_83f7e444.zip Could you please run this at your end and let me know how it goes? Thanks for your patience. Best Regards, Haneef

Fady Sayegh
Replied On April 24, 2006 09:43 AM

Hi Haneef, thanks to your reply, the code you post work fine. if you want to reproduce the bug, try to add these two lines on PrepareViewStyleInfo event to your sample : if (e.RowIndex > 0 && e.ColIndex == 5) e.Style.HorizontalAlignment = GridHorizontalAlignment.Left; sometimes i need to align the check box to the left or to the right. so when i click on the checkbox, nothing happened, but when i click on the left of the check box the state change (from checked to unchecke and vice versa). i don''t know if you see my problem ? but it seems that the control GridDataBoundGrid memorize then initial position of the check box in the cell, and the user have to click always in the memorized area. do you have a solution for that ? best regards and thanks in advance fady

Administrator [Syncfusion]
Replied On April 25, 2006 01:05 AM

Hi Fady, Please use this code in CellClick event to change the cellvalue of the checkbox in a grid .Here is a code snippet. GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(cc.Renderer.CurrentStyle.CellType == "CheckBox") { this.gridDataBoundGrid1.Model[cc.RowIndex,cc.ColIndex].CellValue = !((bool)cc.Renderer.ControlValue) ; } Please let me know if this helps. Regards, Haneef

Fady Sayegh
Replied On April 25, 2006 03:33 AM

Hi Haneef, thanks to your reply, it works fady


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.