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

checkbox and textbox validation in RadGrid

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Esperanza Ramos
Top achievements
Rank 1
Esperanza Ramos asked on 01 Oct 2008, 02:33 PM
Hi, All:

I have 18 columns in my RadGrid.  One of the column is an <asp:CheckBox and another column is with an <asp:TextBox.

I would like to have validation:  whenever the checkbox is checked, that textbox must have something inputed.

Please help.

If you suggest me to use GridChectBoxColumn instead of <asp:CheckBox, I can surely follow.

thanks.

Stanely 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 03 Oct 2008, 09:41 AM
Hi Stanley,

One suggestion will be to add a label along with the TextBox  in the GridTemplateColumn. Then in the onclick client event of the CheckBox access the TextBox and check whether it is empty. Set the error message as the text of the label.

ASPX:
 <telerik:GridTemplateColumn UniqueName="TempCol2" HeaderText="TempCol2" > 
        <ItemTemplate> 
            <asp:Label ID="Label2" runat="server"  ></asp:Label> 
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
        </ItemTemplate> 
       </telerik:GridTemplateColumn> 


Thanks
Shinu.
Tags
Grid
Asked by
Esperanza Ramos
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or