Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I click on a particular column I want to retrieve the values and display the values in textboxes.

XML
<asp:GridView ID="GridView1" runat="server"
                        onselectedindexchanged="GridView1_SelectedIndexChanged"
                        onselectedindexchanging="GridView1_SelectedIndexChanging"
                        ondatabound="GridView1_DataBound"
                        onpageindexchanged="GridView1_PageIndexChanged"
                        onrowcommand="GridView1_RowCommand" onrowediting="GridView1_RowEditing">
                        <Columns>
                        <asp:TemplateField>
                        <ItemTemplate>
                        <asp:LinkButton ID="l1" runat="server" Text='<%#Eval("ypid") %>' OnClick="l1_click"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemTemplate>
                        <asp:Button ID="b1" runat="server" Text='<%#Eval("ypid") %>' OnClick="B1_click" />
                        </ItemTemplate>
                        </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
Posted
Updated 18-Oct-10 20:51pm
v2
Comments
R. Giskard Reventlov 19-Oct-10 2:51am    
What have you already tried? How did that work out?

1 solution

One of the ways would be by adding a 'Select' CommandField column to the GridView.

I am providing a Google search link. There are many links which shows how to do this. Here[^]
 
Share this answer
 
v2
Comments
Dalek Dave 19-Oct-10 3:24am    
Good Answer.
raju melveetilpurayil 19-Oct-10 7:50am    
great.

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