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

GridDataBound - ComboCellType

What''s wrong with this code StringCollection col1 = new StringCollection(); col1.Add("1"); col1.Add("2"); col1.Add("3"); gridBoundColumn2.StyleInfo.ChoiceList = col1; In Deigner the cell type of this column has been assigned to ComboBox Type. i can see the combo box but when i select the items from combo box .. it doesn''t update the grid.. Regards Yogi

5 Replies

AD Administrator Syncfusion Team January 26, 2005 02:36 PM

Are there any exceptions being shown in the output window? Have you set gridBoundColumn2.StyleInfo.CellValueType to something other than string? (or, is the datatype for teh column in the datasource something othe rthan a string?). If so, you will not be able to use a ChoiseList of strings as choices. Instead, you would need to do something like create a datatable and have a column of the same datatype as the grid column, and use that new datatable as the datasource for the gridBoundColumn2.StyleInfo.DataSource. You would also need to set gridBoundColumn2.StyleInfo.ValueMember and DataMember.


AD Administrator Syncfusion Team January 26, 2005 02:53 PM

both cellvaluetype and its underlying datatable column type are string.. it still fails... >Are there any exceptions being shown in the output window? > >Have you set gridBoundColumn2.StyleInfo.CellValueType to something other than string? (or, is the datatype for teh column in the datasource something othe rthan a string?). If so, you will not be able to use a ChoiseList of strings as choices. Instead, you would need to do something like create a datatable and have a column of the same datatype as the grid column, and use that new datatable as the datasource for the gridBoundColumn2.StyleInfo.DataSource. You would also need to set gridBoundColumn2.StyleInfo.ValueMember and DataMember.


AD Administrator Syncfusion Team January 26, 2005 02:58 PM

pretty wierd... i deleted my old data set.. cerated a new one from scratch and then assigned it to DataBoundGrid.. now it is working fine Regards Yogesh S >both cellvaluetype and its underlying datatable column type are string.. it still fails... > >>Are there any exceptions being shown in the output window? >> >>Have you set gridBoundColumn2.StyleInfo.CellValueType to something other than string? (or, is the datatype for teh column in the datasource something othe rthan a string?). If so, you will not be able to use a ChoiseList of strings as choices. Instead, you would need to do something like create a datatable and have a column of the same datatype as the grid column, and use that new datatable as the datasource for the gridBoundColumn2.StyleInfo.DataSource. You would also need to set gridBoundColumn2.StyleInfo.ValueMember and DataMember.


KL Ken Law February 9, 2005 10:30 PM

I am having the exact same problem - my combobox fields in gdbgrids fail in the same manner after moving to 3.0.1.0. I have made sure the gridBoundColumn2.StyleInfo.CellValueType is a string (the underlying datatable column is a string). I also set StrictValueType = False. If I use only mouse clicks to try to select an item from the combobox, it fails but there is no exception. However, if I then try to type into the combobox field (it''s editable), I get the following exception in the output window: System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Grid.GridComboBoxCellModel.GetItemValue(Object dataSource, String valueMember, Object item) at Syncfusion.Windows.Forms.Grid.GridComboBoxCellRenderer.OnKeyPress(KeyPressEventArgs e) at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.ProcessKeyEventArgs(Message& m) at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.RaiseProcessKeyEventArgs(Message& m) at Syncfusion.Windows.Forms.Grid.GridTextBoxControl.ProcessKeyMessage(Message& m) at System.Windows.Forms.Control.WmKeyChar(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.TextBoxBase.WndProc(Message& m) at System.Windows.Forms.RichTextBox.WndProc(Message& m) at Syncfusion.Windows.Forms.Grid.GridTextBoxControl.WndProc(Message& msg) catched at Syncfusion.Windows.Forms.Grid.GridTextBoxControl


AD Administrator Syncfusion Team February 10, 2005 06:36 PM

Ken, we made a couple of fixes with Combobox after 3.0.1.0 but I am not sure if that is related to your problem. If you prepare a sample project we can debug into it. Thanks, Stefan >I am having the exact same problem - my combobox fields in gdbgrids fail in the same manner after moving to 3.0.1.0. I have made sure the gridBoundColumn2.StyleInfo.CellValueType is a string (the underlying datatable column is a string). I also set StrictValueType = False. > >If I use only mouse clicks to try to select an item from the combobox, it fails but there is no exception. However, if I then try to type into the combobox field (it''s editable), I get the following exception in the output window: > >System.NullReferenceException: Object reference not set to an instance of an object. > at Syncfusion.Windows.Forms.Grid.GridComboBoxCellModel.GetItemValue(Object dataSource, String valueMember, Object item) > at Syncfusion.Windows.Forms.Grid.GridComboBoxCellRenderer.OnKeyPress(KeyPressEventArgs e) > at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.ProcessKeyEventArgs(Message& m) > at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.RaiseProcessKeyEventArgs(Message& m) > at Syncfusion.Windows.Forms.Grid.GridTextBoxControl.ProcessKeyMessage(Message& m) > at System.Windows.Forms.Control.WmKeyChar(Message& m) > at System.Windows.Forms.Control.WndProc(Message& m) > at System.Windows.Forms.TextBoxBase.WndProc(Message& m) > at System.Windows.Forms.RichTextBox.WndProc(Message& m) > at Syncfusion.Windows.Forms.Grid.GridTextBoxControl.WndProc(Message& msg) >catched at Syncfusion.Windows.Forms.Grid.GridTextBoxControl > >

Loader.
Live Chat Icon For mobile
Up arrow icon