Please help me with this:
I have this problem between the old version and new version (2012.3.1038.40 vs 2013.3.1015.40)
I am using customized column editor (I want a drop-down, rather a free-style type field), pelase see the code in the end.
my question is, the following code works perfectly with version 2012.3.1038.40 (I know it is an old version)
but after I referred to the new Telerik.Web.UI with version 2013.3.1015.40, I got exception as below
[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Web.UI.GridTextBoxColumnEditor.CreateControls() +264
Telerik.Web.UI.GridColumnEditorBase.EnsureControlsCreated() +56
Telerik.Web.UI.GridColumnEditorBase.InitializeInControl(Control containerControl) +77
...
...
by setting debug line in customized editor class, I found out that with the new version, AddControlsToContainer() never get called
If I switch back the old DLL version, everything is just working fine.
we are desperately looking for help!!!
Just cannot upgrade any newer version
Thanks in advance
//Here is the event to create my own column editor
//
protected void RadGridMHomeMCM_CreateColumnEditor(object sender, GridCreateColumnEditorEventArgs e)
{
if (e.Column is GridBoundColumn && e.Column.UniqueName.StartsWith("CAP"))
{
e.ColumnEditor = new ClsCustomDropDownList();
}
}
//Here is my column editor class
//
private class ClsCustomDropDownList : GridTextBoxColumnEditor
{
private RadComboBox ddlEditor;
protected override void CreateControls()
{
this.ddlEditor = new RadComboBox();
this.ddlEditor.Items.Add(new RadComboBoxItem("Yes", "Yes"));
this.ddlEditor.Items.Add(new RadComboBoxItem("No", "No"));
}
protected override void LoadControlsFromContainer()
{
this.ddlEditor = this.ContainerControl.Controls[0] as RadComboBox;
}
public override bool IsInitialized
{
get { return this.ddlEditor != null; }
}
public override string Text
{
get { return this.ddlEditor.Text; }
set { this.ddlEditor.Text = value; }
}
protected override void AddControlsToContainer()
{
ddlEditor = new RadComboBox();
ddlEditor.Items.Add(new RadComboBoxItem("Yes", "Yes"));
ddlEditor.Items.Add(new RadComboBoxItem("No", "No"));
this.EnsureControlsCreated();
this.ContainerControl.Controls.Add(this.ddlEditor);
}
}
I have this problem between the old version and new version (2012.3.1038.40 vs 2013.3.1015.40)
I am using customized column editor (I want a drop-down, rather a free-style type field), pelase see the code in the end.
my question is, the following code works perfectly with version 2012.3.1038.40 (I know it is an old version)
but after I referred to the new Telerik.Web.UI with version 2013.3.1015.40, I got exception as below
[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Web.UI.GridTextBoxColumnEditor.CreateControls() +264
Telerik.Web.UI.GridColumnEditorBase.EnsureControlsCreated() +56
Telerik.Web.UI.GridColumnEditorBase.InitializeInControl(Control containerControl) +77
...
...
by setting debug line in customized editor class, I found out that with the new version, AddControlsToContainer() never get called
If I switch back the old DLL version, everything is just working fine.
we are desperately looking for help!!!
Just cannot upgrade any newer version
Thanks in advance
//Here is the event to create my own column editor
//
protected void RadGridMHomeMCM_CreateColumnEditor(object sender, GridCreateColumnEditorEventArgs e)
{
if (e.Column is GridBoundColumn && e.Column.UniqueName.StartsWith("CAP"))
{
e.ColumnEditor = new ClsCustomDropDownList();
}
}
//Here is my column editor class
//
private class ClsCustomDropDownList : GridTextBoxColumnEditor
{
private RadComboBox ddlEditor;
protected override void CreateControls()
{
this.ddlEditor = new RadComboBox();
this.ddlEditor.Items.Add(new RadComboBoxItem("Yes", "Yes"));
this.ddlEditor.Items.Add(new RadComboBoxItem("No", "No"));
}
protected override void LoadControlsFromContainer()
{
this.ddlEditor = this.ContainerControl.Controls[0] as RadComboBox;
}
public override bool IsInitialized
{
get { return this.ddlEditor != null; }
}
public override string Text
{
get { return this.ddlEditor.Text; }
set { this.ddlEditor.Text = value; }
}
protected override void AddControlsToContainer()
{
ddlEditor = new RadComboBox();
ddlEditor.Items.Add(new RadComboBoxItem("Yes", "Yes"));
ddlEditor.Items.Add(new RadComboBoxItem("No", "No"));
this.EnsureControlsCreated();
this.ContainerControl.Controls.Add(this.ddlEditor);
}
}