Validate

M

Music Lover

how can I validate the values entered in the textbox inside the datagrid?

Thanks
 
R

Raúl Fdez.

Hi!

I put this code in my html:

<asp:TemplateColumn HeaderText="ImporteMto" SortExpression="ImporteMto"
HeaderStyle-ForeColor="#000000">
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.ImporteMto") %>' ID="Item_importemto">
</asp:Label>
<asp:RequiredFieldValidator ControlToValidate="Item_importemto"
Display="Dynamic" ErrorMessage="Importe
Obligatorio!!"></asp:RequiredFieldValidator>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.ImporteMto") %>' ID="Edit_importemto" MaxLength="50">
</asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="Edit_importemto"
Display="Dynamic" ErrorMessage="Importe
Obligatorio!!"></asp:RequiredFieldValidator>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox runat="server" Text='' ID="insert_importemto"
MaxLength="50"></asp:TextBox>
</FooterTemplate>
</asp:TemplateColumn>

This is not execute ok

¿What i do wrong?

Thanks and sorry by my english
 
J

Joel .NET

It's the same. First you have to create a template for that column. Next you
just have to drag a textbox with a corresponding validation control inside
the edit template

Joel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,125
Latest member
VinayKumar Nevatia_
Top