Outside Webdatagrid, I had used Required & Regularexpression validator like below to validate if year is ok. But the issue is that even when the condition is satisfied, still it displays & hence Save event in Code behind is not fired.
<ig:WebDataGrid ID="WebDataGrid1" ClientIDMode="Static" runat="server" Height="350px" Width="400px" AutoGenerateColumns="false" DataKeyFields="Id" > <Columns> <ig:BoundDataField DataFieldName="Id" Key="Id" Hidden="true"> </ig:BoundDataField>
<ig:BoundDataField DataFieldName="Year" Key="CYear"> <Header Text="Year" /> </ig:BoundDataField>
.......................
</Columns>
......
</ig:WebDataGrid>
<asp:RequiredFieldValidator Id="rfvYear" runat="server" ControlToValidate="WebDataGrid1" ErrorMessage="Please enter value" />
<asp:RegularExpressionValidator Id="reYear" runat="server" ControlToValidate="WebDataGrid1" ErrorMessage="Year:9999" />
Hello Aujla,
The WebDataGrid has support to allow you to use various ASP.NET validator controls when editing the grid's cells. We have created this YouTube video which demonstrates how to set up different validators such as the RequiredFieldValidator and a CustomValidator in the grid.
Go through the video and let me know if you still need further assistance.
Thanks for replying. My issue is webdatagrid required validator displays message even when Year text is filled. Message is not removed and hence code behind Save event is not fired.