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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with Check box handling : GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

12619 Apr 5,2004 11:09 AM UTC Apr 6,2004 12:12 PM UTC WinForms 3
loading
Tags: GridControl
Supriya
Asked On April 5, 2004 11:09 AM UTC

Hi, I am trying to set the grid style using following code: gridAlarmDetails.Binder.InternalColumns[Index].StyleInfo.CellType = "CheckBox"; gridAlarmDetails.Binder.InternalColumns[Index].StyleInfo.CellValueType = typeof(bool); gridAlarmDetails.Binder.InternalColumns[Index].StyleInfo.CellValue = false; I gives a error, "index out of range". I tried giving string (Column name) instead of Index, i do not give any error but changes are not reflected. Same code is working fine in another Form. Only different between the two form is that in working form grid is directly added to Form while in non-working code grid is added in Tab-page which is added to form. Thanks, Supriya Grid_1712.zip

Administrator [Syncfusion]
Replied On April 5, 2004 12:19 PM UTC

Hi Supriya, I saw those two files, i guess you are having trouble in this AlarmsManagerUI-InsideTab.cs. In that i see you are trying to set the check box styles using this code instead of the above posted code. gridAlarmDetails.Model.ColStyles[ColName].CellType = "CheckBox"; gridAlarmDetails.Model.ColStyles[ColName].CellValueType = typeof(bool); gridAlarmDetails.Model.ColStyles[ColName].CellValue = false; Instead of this try setting the properties by accessing the styleinfo properties through binder and set the checkboxoptions property to see if that helps. gridAlarmDetails.Binder.InternalColumns[Index].CheckBoxOptions = new Syncfusion.Windows.Forms.Grid.GridCheckBoxCellInfo(true.ToString(), false.ToString(), "", true); Also what version of the grid are you using? Regards, Jay N

Rajiv
Replied On April 6, 2004 02:00 AM UTC

Hi Jay, We tried seting the properties using the binder but i was giving ''Invalid Index Error'' so we tried other ways. Same code works fine if i remove tab control and add grid control directly to Form. Thanks and Regards, Rajiv >Hi Supriya, >I saw those two files, i guess you are having trouble in this AlarmsManagerUI-InsideTab.cs. In that i see you are trying to set the check box styles using this code instead of the above posted code. > > >gridAlarmDetails.Model.ColStyles[ColName].CellType = "CheckBox"; >gridAlarmDetails.Model.ColStyles[ColName].CellValueType = typeof(bool); >gridAlarmDetails.Model.ColStyles[ColName].CellValue = false; > > >Instead of this try setting the properties by accessing the styleinfo properties through binder and set the checkboxoptions property to see if that helps. > >gridAlarmDetails.Binder.InternalColumns[Index].CheckBoxOptions = new Syncfusion.Windows.Forms.Grid.GridCheckBoxCellInfo(true.ToString(), false.ToString(), "", true); > > >Also what version of the grid are you using? > >Regards, >Jay N

Administrator [Syncfusion]
Replied On April 6, 2004 12:12 PM UTC

Hi Rajiv, I suspect it is because at that time when you try to assign the styleinfo properties, the grid was not initialized yet and therefore there are no InternalColumns and that’s why there is an exception being thrown. Try checking the InternalColumns.Count at the moment when you try to access it. Is it possible to move that code out of the form''s constructor to the Form_Load event handler. Then there is a better chance that the control has been fully created and its BindingContext initialized. Attached is a sample that has a GDBG in a tabpage with a checkbox column. Thanks, Jay N forum_checkbox.zip

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.

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

;