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

[Solved] Custom Editors in RadGrid

1 Answer 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maxim Tairov
Top achievements
Rank 1
Maxim Tairov asked on 31 Mar 2009, 09:04 AM

Hello Telerik!

I have use RadControls for ASP.NET AJAX 2008 3 1314

In my project I use custom editors in RadGrid. Everything works fine while I don't use custom editor for GridDropDownColumn. For this column type, custom editor doesn't work properlly when EnableEmptyListItem = true.

In this case column try to convert my custom editor to GridDropDownListColumnEditor (instead of GridDropDownColumnEditor).

See your code (method GridDropDownColumn.OnDataBindColumn())

if (this.EnableEmptyListItem)  
  {  
    if (this.DropDownControlType == GridDropDownColumnControlType.RadComboBox)  
    {  
      if (((GridDropDownListColumnEditor) this.DropDownListEditor).ComboBoxControl.FindItemByValue(this.EmptyListItemValue) == null)  
      {  
        RadComboBoxItem item3 = new RadComboBoxItem(this.EmptyListItemText, this.EmptyListItemValue);  
        ((GridDropDownListColumnEditor) this.DropDownListEditor).ComboBoxControl.Items.Insert(0, item3);  
      }  
    }  
    else if (((GridDropDownListColumnEditor) this.DropDownListEditor).DropDownListControl.Items.FindByValue(this.EmptyListItemValue) == null)  
    {  
      ListItem item5 = new ListItem(this.EmptyListItemText, this.EmptyListItemValue);  
      ((GridDropDownListColumnEditor) this.DropDownListEditor).DropDownListControl.Items.Insert(0, item5);  
    }  
  } 

In latest realse situation the same. Please fix it or explain how can I use custom editor with GridDropDownColumn and use EnableEmptyListItem property. 

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 03 Apr 2009, 10:17 AM
Hi Maxim Tairov,

Please, find attached a small sample demonstrating how to implement a custom editor for the drop down column of the grid.

Best Regards,
Tsvetoslav
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Maxim Tairov
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or