Hello,
I've a problem with (as I suppose) data binding to dynamically generated grid.
Below you will find events fired when I try to edit item in grid (InPlace).
Columns in grid are dynamically generated - bacically there are 2 types of columns:
- dictionary: GridDropDownColumn (working ok)
- numeric: GridNumericColumn (cause of problems)
Grid could have multiple columns of both types depending on the underlying business object.
Problem is: when I click edit on grid item the editors are not showing.
Here is a events trace which are raised:
// loading a page
Page_Init
GenerateDefinitionColumns
CreateColumnForVariable: Dictionary 1
CreateColumnForVariable: Numeric 1
rgDefinitionItems_NeedDataSource
rgDefinitionItems_CreateColumnEditor: Creating column editor for column: IN1
rgDefinitionItems_ItemDataBound: Binding item in view mode
rgDefinitionItems_ItemDataBound: Binding item in view mode
// here I've clicked edit button on grid
Page_Init after postback
rgDefinitionItems_CreateColumnEditor: Creating column editor for column: IN1
rgDefinitionItems_ItemCommand: Command name: Edit
rgDefinitionItems_NeedDataSource
rgDefinitionItems_ItemDataBound: Binding item in edit mode
rgDefinitionItems_CreateColumnEditor: Creating column editor for column: OUT2
In attached sample project you could methods GetCellValue & SetValueToCell
responsible for geting and setting value into cell (in both view and edit mode).
If you remove from those methods "if (dataItem[columnUniqueName].Controls.Count > 0)"
you will see my problem - the editor control for numeric column is not created yet :(
Source code for this problem can be downloaded from dropbox:
http://dl.getdropbox.com/u/1495591/RadGridDataBindingProblem.zip
Any ideas what's wrong ?