Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > gridview

Reply
Thread Tools

gridview

 
 
cacososa cacososa is offline
Junior Member
Join Date: Sep 2011
Posts: 1
 
      09-30-2011
Hi I have a gridview and here is what I'm trying to do.

For each row in the gridview I want to add a column with a link or image button. When the user clicks on the link I would like to fill some form fields with the data from the row that the user clicked on.

I added a templatefield to my gridview and now I have the link that I wanted. What I can't figure out is how to get the data from the row and fill the form fields with that data.

Can anyone help me out..

here is my code for the gridview

Code:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="CI_Paciente" 
    DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                SortExpression="Nombre" />
            <asp:BoundField DataField="CI_Paciente" HeaderText="CI_Paciente" 
                ReadOnly="True" SortExpression="CI_Paciente" />
            <asp:BoundField DataField="Apellido" HeaderText="Apellido" 
                SortExpression="Apellido" />
            <asp:BoundField DataField="Historia" HeaderText="Historia" 
                SortExpression="Historia" />
            <asp:BoundField DataField="Primera_Visita" HeaderText="Primera_Visita" 
                SortExpression="Primera_Visita" />
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                     <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/images/comunes/edit.gif" CommandArgument='<%# Eval("CI_Paciente")  %>' OnClick='??' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
Thanks in advance
Carlos
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
Gridview inside Gridview little problems... Carlos Albert ASP .Net 1 12-06-2005 05:31 PM
GridView in a GridView Carlos Albert ASP .Net 2 12-06-2005 12:42 PM
GridView in a GridView Nalaka ASP .Net 6 12-05-2005 05:48 PM
Gridview with combobox whose data is dependent on field in gridview wallermj@hotmail.com ASP .Net 3 11-21-2005 05:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57