BigJim
BigJim

Reputation: 411

Multiple control validation in radgrid

Hi say I have a couple of fields in my RadGrid:

<telerik:GridTemplateColumn HeaderText="ProductName" >
<EditTemplate>
<asp:TextBox ID="info" runat="server" Text='<%# Bind("ProductName") %>' />
</EditTemplate>
   </telerik:GridTemplateColumn >
<telerik:GridDropDownColumn DataField="CategoryID" DataSourceID="SqlDataSource1"
                        HeaderText="Category" ListTextField="CategoryName" ListValueField="CategoryID"
                        UniqueName="CategoryID" ColumnEditorID="GridDropDownColumnEditor1">
 </telerik:GridDropDownColumn>

What I want to achieve here is to have some validation that says the textbox is a required field if the item in the dropdown box is set to a certain value say "Jam".

I'm not sure how to do the validation across these two controls. Any suggestions?

Upvotes: 1

Views: 2331

Answers (1)

BigJim
BigJim

Reputation: 411

No worries, I managed to sove it by doing a couple of FindControl commands in the CustomValidator ServerValidate method.

Finding a combobox:

((RadComboBox)((CustomValidatore)source).FindControl("TextBoxName"))

Upvotes: 0

Related Questions