aspx side:
//OnUpdateCommand="UpdateCommand" (grid proterty wiring my routine)
<asp:boundcolumn ItemStyle-CssClass="text" HeaderText="Email" DataField="Email"></asp:boundcolumn
<asp:EditCommandColumn ItemStyle-CssClass="text" runat="server" EditText="Edit" UpdateText="OK" CancelText="Cancel"></asp:EditCommandColumn
codebehind:
protected void UpdateCommand(object sender, DataGridCommandEventArgs e)
{
//make textbox
TextBox email = (TextBox)e.Item.Cells[2].Controls[0];
//Can I make a regularexpresson val for email?
//Do an update here
}You have to use templates for the grid. Just add the validators inside the template you control to validate is and set the controltovalidate property to the control id you want to validate i.
I have my validator at the footer template to add item. how can I stop it from firing when I click on the "Edit" button at the edit template?
thank you!
No comments:
Post a Comment