Click here to Skip to main content
15,898,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<tr>
 <asp:GridView ID="gvWH" runat="server" BorderColor="#BDBDBD" ShowFooter="True"
 CssClass="center" OnRowDataBound="gvWH_RowDataBound"
 GridLines="Horizontal" OnRowDeleting="gvWH_RowDeleting"
AutoGenerateColumns="False">
   <EmptyDataTemplate>
       No Records found
   </EmptyDataTemplate>
        <Columns>
            <asp:TemplateField HeaderText="Type">
                <HeaderStyle HorizontalAlign="Center" />
                     <ItemTemplate>
                     <asp:DropDownList ID="ddlbirdtype" runat="server"
                         AutoPostBack="true">
                      </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RFVbirdtype" runat="server"
                      ControlToValidate="ddlbirdtype"
                  ValidationGroup="GridView1" InitialValue="0" Display="None"
                 ErrorMessage="Please select Bird Type"></asp:RequiredFieldValidator>
              <asp:ValidatorCalloutExtender ID="VCEbirdtype" runat="Server"
              TargetControlID="RFVbirdtype" EnableViewState="false" />
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Weight">
           <HeaderStyle HorizontalAlign="Center" />
             <FooterStyle HorizontalAlign="Right" />
               <FooterTemplate>
            <asp:Button ID="BtnAdd" runat="server" Text="Add" OnClick="BtnAdd_Click"
             ValidationGroup="GridView1" CausesValidation="true" />
                </FooterTemplate>
              <ItemStyle Width="100px" />
              </asp:TemplateField>
               <asp:CommandField ShowDeleteButton="True" />
        </Columns>
      </asp:GridView>
  </tr>
  <tr>
     <td align="center">
   <asp:Button ID="btnsave" runat="server" Text="Save" OnClick="btnSave_Click" OnClientClick="return validations1();" ValidationGroup="GridView1" CausesValidation="true"
     Style="height: 26px" />
     </td>
  </tr>



When i click on Outside "Save" button then it shows validations ..
Posted
Updated 28-Dec-13 0:40am
v2

use 'ValidationGroup' properties of the controls............
 
Share this answer
 
use 'ValidationGroup properties of the controls........
 
Share this answer
 
Comments
Siva Hyderabad 28-Dec-13 6:05am    
Thanks for reply.. I already used "ValidationGrop"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900