Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1230
Webdatagrid Validator Issue
posted

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" />

Parents
No Data
Reply
  • 7375
    Offline posted

    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.

Children