Hi, You can use validations in EditItemTemplate for validating the value to be updated in a particular row of the grid view. All kind of Asp.net validator controls can be used in EditItemTemplate, I am giving example using RegularExpressionValidator. Here the validation will work when user try to update the textbox value in grid-view row. The definition of grid-view would look like:
<asp:GridView ID="MyGridview" runat="server" AutoGenerateColumns="false" OnRowEditing="MyGridview_RowEditing"
OnRowUpdating="MyGridview_RowUpdating">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtItem" runat="server" ReadOnly="true" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtedit" runat="server" />
<asp:RegularExpressionValidator ID="regEx" runat="server" ErrorMessage="Provide alphanumeric."
ControlToValidate="txtedit" ValidationExpression="^[a-zA-Z0-9_]*$" ValidationGroup="updateGrp"></asp:RegularExpressionValidator>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkEdit" Text="Edit" runat="server" CommandName="Edit" CausesValidation="false" />
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="lnkUpdate" Text="Update" runat="server" CommandName="Update"
CausesValidation="True" ValidationGroup="updateGrp" />
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Make sure you set the "CausesValidation" and "ValidationGroup" properties properly. :)