This is a migrated thread and some comments may be shown as answers.

setting enumerations in combobox Cell Element seams to crash the grid

1 Answer 21 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Erion
Top achievements
Rank 1
Erion asked on 08 Sep 2011, 04:38 PM
Hi I am using the Gridview, to display some data. I have a tax filing status column, which I am giving it the values of the combo box from an enumeration, like the following. 


(gridViewTemplateTaxData.Columns["FilingStatus"] as GridViewComboBoxColumn).DataSource = Enum.GetNames(typeof(TaxFilingStatus));

When I the user changes the value in the combo box, I change the bound data of the grid. Then I refresh the templates of the grid. 
Some of the time this works fine, but often enough, I get the following exception. 

Object reference not set to an instance of an object. 

Telerik.WinControls.UI.GridComboBoxCellElement.SetContent().  I walked through the code that I have in the cell value changed, and there is no issues there. Am I using the ComboBoxColumn wrong ? 

- Erion

1 Answer, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 09 Sep 2011, 05:47 AM
Hello,

if you are changing the data source in the cell value changed event this could lead to some strange results.

Could you please post some snippets, or a new very small project where this occurs, to make it easier to find a working solution.

Best Regards,
Emanuel Varga,

WinForms MVP
Tags
GridView
Asked by
Erion
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Share this question
or