Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hellow
In one of mine application i am using 2 gridview to display data. i want to display data in gridview2 on click of gridview1 any where in row. i do not want to use gridviw1_rowCommand event.
how can i develop such application.
Kindly give me hint.
Posted

 
Share this answer
 
Hi @Aftab5124

If you don't want to use the grid view row command then you can use commandname property for each control.and under that command name perform what you want to do.
for ex
XML
<asp:GridView ID="GridView1" runat="server" BackColor="White"
           BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3"
           CellSpacing="1" GridLines="None">
           <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
           <Columns>
              <asp:TemplateField>
              <ItemTemplate>
              <asp:Button runat="server" Text="clickme" CommandName="showdata()" />
              </ItemTemplate>
              </asp:TemplateField>
               <asp:TemplateField>
              <ItemTemplate>
              <asp:LinkButton ID="Button2" runat="server" Text="clickme" CommandName="showdata()"></asp:LinkButton>
              </ItemTemplate>
              </asp:TemplateField>
           </Columns>
           <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
           <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
           <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
           <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
       </asp:GridView>


Here i have called the showdata command name for the button1 as well as the button2

Hope it will help you

Thanks
 
Share this answer
 
v2

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