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.

Checkbox

Thread ID:

Created:

Updated:

Platform:

Replies:

44190 May 16,2006 10:48 AM May 17,2006 12:00 AM Windows Forms 1
loading
Tags: GridControl
Ravichandran
Asked On May 16, 2006 10:48 AM

I am using Virtual GridControl in which one of the col type is "CheckBox". But I am not able to check and uncheck the col. I tried the follwing code piece even though it is not setting the value to the cell. GridCurrentCell cc = CurrentCell; if(cc.Renderer.StyleInfo.CellType == "CheckBox") { this.Model[cc.RowIndex,cc.ColIndex].CellValue = !((bool)cc.Renderer.ControlValue) ; } Pls help. Regards Ravi

Administrator [Syncfusion]
Replied On May 17, 2006 12:00 AM

Hi Ravichandran , You need to set the cell''s CheckBoxOptions property of the Grid. CheckBoxOptions.CheckedValue is used to specify what value should be given in the CellValue to make the checkbox checked (ie., either "1" or "true"). Say for example if you want "true" to be checked and "false" to be unchecked state. Here is the code snippet. this.gridControl1[1,1].CellType = "CheckBox"; this.gridControl1[1,1].CheckBoxOptions.CheckedValue = "true"; this.gridControl1[1,1].CheckBoxOptions.UncheckedValue = "false"; this.gridControl1[1,1].CellValueType = typeof(bool); this.gridControl1[1,1].CellValue = true; You can also set "1" and "0" to be checked and unchecked values in the similar way. Best Regards, Haneef

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.

;