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
731
How To Restrict Specific Column to be entered NULL?
posted

in Ultrawebgrid  i want to have requried field validator like thing / client side validation on column[0] if user does not enter a value it should point out that perticular cell and stop execution... please guide how to achieve this?????

  • 28464
    posted

     

    UltraWebGrid supports validators for columns, so you can just use RequiredFieldValidator to make sure the text entered for a columns is not empty (Null). Here is an example:

    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="UltraWebGrid1" runat="server" ErrorMessage="ErrorMessage" EnableClientScript=true Display=Static>
      </asp:RequiredFieldValidator>
        <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" Height="200px" Width="325px"
            DataSourceID="SqlDataSource1">
            <Bands>
                <igtbl:UltraGridBand>
                    <Columns>
                        <igtbl:UltraGridColumn BaseColumnName="CustomerID" IsBound="True" Key="CustomerID">
                            <Header Caption="CustomerID">
                            </Header>                        
                        </igtbl:UltraGridColumn>
                        <igtbl:UltraGridColumn BaseColumnName="CompanyName" IsBound="True" Key="CompanyName">
                            <Header Caption="CompanyName">
                                <RowLayoutColumnInfo OriginX="1" />
                            </Header>
                            <Validators>
                                <igtbl:ValidatorItem  Value="RequiredFieldValidator1"  />
                            </Validators>

                             <Footer>
                                <RowLayoutColumnInfo OriginX="1" />
                            </Footer>
                        </igtbl:UltraGridColumn>

     More info can be found in the following forum thread:

    http://forums.infragistics.com/forums/p/9092/68843.aspx#68843