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

[Solved] EnableEmptyListItem not working

1 Answer 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert O'Dell
Top achievements
Rank 1
Robert O'Dell asked on 22 Jan 2008, 10:40 PM
I was trying to get EnableEmptyListItem to work with prometheus, but it will not.  It works just like the documentation sugges if I change to RADgrid.  I also tried it from the code behind on ItemDataBound using essentially the demo code

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)

{

if (e.Item is GridEditableItem && e.Item.IsInEditMode)

{

GridEditableItem editedItem = e.Item as GridDataItem;

GridEditManager editMan = editedItem.EditManager;

GridDropDownListColumnEditor editor = (GridDropDownListColumnEditor)(editMan.GetColumnEditor("Elem_QEDStdTbl"));

DropDownList ddList = editor.DropDownListControl;

ddList.Items.Insert(0,

new ListItem("Select Contact Title", "NotSetItem"));

ddList.Items[0].Attributes[

"style"] = "color: red";

ListItem item = new ListItem();

item.Text =

"new item";

item.Value =

"0";

ddList.Items.Add(item);

}

}

Under prometheus - nothing is added.  Under RadGrid, both items (the insert and add) are shown.

1 Answer, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 23 Jan 2008, 07:07 AM
Hello Robert,

Unfortunately I have to admit that GridDropDownColumn.EnableEmptyListItem does not work when the control
editor is RadComboBox with the latest official release. However, our developers reacted immediately and you can ask our support officers for hotfix through a formal support ticket. Alternatively, you can set the column type as DropDown and wait for the Service Pack, which will include the bug fix.

Please, excuse us for the caused inconvenience.

Sincerely yours,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Robert O'Dell
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Share this question
or