Home Forums WinForms controls Xceed Grid for WinForms Adding Check Box For Unbound Column for NON boolean Data type in Xceed Grid Version 2.2 Reply To: Adding Check Box For Unbound Column for NON boolean Data type in Xceed Grid Version 2.2

User (Old forums)
Member
Post count: 23064

Thanks Ghislain for your quick response.

I am afraid that the solution you have given is not applicable in the Xceed grid that i am working with. Please note that the Xceed Grid i am working with is of version 2.2 and it is not having a CellViewManager or CellEditorManager class and neither CheckBoxEditor nor CheckBoxViewer class.

The only class that is suppoted here is CellEditor/CellViewer with CustomEditor and ControlViewer class. I am attaching a piece of snippet that i am using which is not fully functional.

The code that Creates a Check box in the cell is as follows where AttributeName and Attributevalues are the “Name” & “Values” w.r.t the table format that i have defined earlier in my Mail.

===============================================================================

Dim

newRow As Xceed.Grid.DataRow = grdDinDetail.DataRows.AddNew()

Dim chkBox As New Xceed.Grid.Editors.GridCheckBox

newRow.Cells(“colName”).Value = attributeName

newRow.Cells(“colValue”).HorizontalAlignment = HorizontalAlignment.Center

newRow.Cells(“colValue”).VerticalAlignment = VerticalAlignment.Center

newRow.Cells(“colValue”).CellViewer = chkBox

newRow.Cells(“colValue”).CellEditor = chkBox

newRow.Cells(“colValue”).Value = attributeValue

newRow.EndEdit()

===============================================================================

The code to Create a Normal Row Entry is as follows

 Dim

newRow As Xceed.Grid.DataRow = grdDinDetail.DataRows.AddNew()

newRow.Cells(“colName”).Value = attributeName

newRow.Cells(“colValue”).Value = attributeValue  ‘The attaribute value can be of any data type like string,integer

newRow.EndEdit()

================================================================================

I call the above piece of code in a sequence to

1. Create a Normal row whose value can be of any data type such as string, integer etc in the “colValue”

2. Create a CheckedBox row whose value can be a boolean in the “colValue”

Now the Block or bottle Neck is, which ever the code i call first, the “colValue” is holding that type of data i.e if call “1” first and then “2” then column “colValue” can hold only string/Integer or else if i call “2” first and then “1” the “colValue” can hold boolean datatype only and no other type. Please note that the data type of  “colValue” is of type Object. This is done so that the colValue can hold any data type value.

 Buttom line is i need to achieve the table strcuture that i have specified in the first mail which can hold any kind of data along with any type of control in it. In my case the control it is check box. So i need a workable piece of code for version 2.2 to have  both control and datatype variants. For your Ref i am specifying the Table structure

ColName                       ColValue

Andre                           20987

Domain                         Petro Expert

Married                         <%CheckBox%>

Age                               23

 

I just need to acheive the above. Please advice

 

Thanks

Mahesh

Imported from legacy forums. Posted by Mahesh (had 2759 views)