6 Answers, 1 is accepted

Try the following code snippet to achieve your scenario.
C#:protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditFormItem && e.Item.IsInEditMode && !e.Item.OwnerTableView.IsItemInserted)
{
GridEditFormItem item = (GridEditFormItem)e.Item;
RadComboBox combo = (RadComboBox)item.FindControl(
"RadComboBox1"
);
if
(combo.SelectedValue ==
"Value"
)
{
RadTextBox rtxt = (RadTextBox)item.FindControl(
"RadTextBox1"
);
rtxt.Enabled =
false
;
}
}
}
Shinu

Now, how would I get a handle to RadTextBox.Enabled in event RadComboBox.SelectedIndexChanged?
Thanks again,
Rick

I have tried to get a handle to textbox like this:
Protected
Sub rcbSource_OnSelectedIndexChanged(ByVal source As Object, ByVal e As _ RadComboBoxSelectedIndexChangedEventArgs)
Dim rtb as RadTextBox = CType(Me.FindControl("rtbName"), RadTextBox)
End Sub
===> But rtb returns as Nothing. Here is the EditForm insided MasterTableView (RadGrid):
...
<EditFormSettings CaptionFormatString="Edit" CaptionDataField="id" EditFormType="Template"
InsertCaption="Insert New">
<EditColumn ButtonType="PushButton" CancelText="Cancel" UpdateText="Save" />
<PopUpSettings Modal="True" />
<FormTemplate>
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Source"></asp:Label>
</td>
<td>
<telerik:RadComboBox ID="rcbSource" Runat="server" DataSourceID="sdsSources"
DataTextField="src_name" DataValueField="src_id" AutoPostBack="true"
SelectedValue='<%# Bind("src_id") %>' Skin="Black"
OnSelectedIndexChanged="rcbSource_OnSelectedIndexChanged">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td> </td>
<td>
<telerik:RadTextBox ID="rtbName" runat="server" Text='<%# Bind("src_text") %>'></telerik:RadTextBox>
</td>
</tr>
<tr>
<td> </td>
<td>
<telerik:RadButton ID="btnUpdate" runat="server" Text="Save" CausesValidation="True"
CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
</telerik:RadButton>
<telerik:RadButton ID="btnCancel" runat="server" CommandName="Cancel"
Text="Cancel">
</telerik:RadButton>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>

I was just looking at your post, and wondered if there's a typo in the example posted here in the forum, or if this is the way it is in your project. If it is this way in your project, it seems as though you're looking for a control with the name of MyRadTextBox, but the ID of the RadTextBox is rtbName.

I should also mention our use of nested Master pages. I not sure how to drill down into the Telerik controls to get to rtbName.

Protected Sub rcbSource_OnSelectedIndexChanged(ByVal source As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs)
Dim rcb As RadComboBox = CType(source, RadComboBox)
Dim x As Panel = rcb.Parent
Dim rtb As RadTextBox = CType(x.FindControl("rtbName"), RadTextBox)
If rcb.SelectedItem.Text = "other" Then
rtb.Enabled = True
Else
rtb.Enabled = True
End If
Thanks all.
Rick