4 Answers, 1 is accepted

You can try the following code snippet in the ItemDataBound event of the RadComboBox.
C#:
protected
void
RadComboBox2_ItemDataBound(
object
sender, RadComboBoxItemEventArgs e)
{
if
(e.Item.Text ==
"5"
)
{
RadComboBoxItem item = e.Item
as
RadComboBoxItem;
item.Visible =
false
;
}
}
Thanks,
Shinu.

If I could just run another one by you.
I have radgrid databound, on edit (Inline Edit) I wish to use a dropdownlist for a field and populate certain items e.g Date, Time etc.
However it should show the databound field when out of edit mode.
Ive tried the below but on edit the dopdownlist doesnt seem to populate.
Thanks
<%--Aspx--%>
<telerik:GridTemplateColumn UniqueName="YFieldName" HeaderText="YFieldName">
<ItemTemplate>
<%# Eval("YFieldName") %>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList runat="server" ID="YField">
</asp:DropDownList>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<%--Aspx.vb--%>
Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim dropDownList As DropDownList = DirectCast(item("YFieldName").FindControl("YField"), DropDownList)
DropDownList.DataSource =
New [String]() {"Date", "Time", "Year"}
DropDownList.DataBind()
End If
End Sub

I have tried the same code at my end and the DropDownList populated correctly. Please make sure the loop is getting executed. Also ensure that the EditMode is InPlace.
Thanks,
Princy.

It did work, had a typo myside.