Click here to Skip to main content
16,018,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my Gridview code:
XML
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="5"
        AutoGenerateColumns="False" BackColor="White" BorderColor="White"
        BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1"
        DataKeyNames="PostDoubtID" DataSourceID="SqlDataSource1"
    GridLines="None" Width="918px">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:BoundField DataField="Topic" HeaderText="Topic" SortExpression="Topic" />
            <asp:BoundField DataField="Subject" HeaderText="Subject"
                SortExpression="Subject" />
            <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
            <asp:TemplateField HeaderText="Doubts In Detail">
                <ItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Height="76px"
                        Text='<%# Bind("YourDoubt") %>' TextMode="MultiLine" Width="400px"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Reply">
                <ItemTemplate>
                    <asp:Button ID="Button1" runat="server" Height="27px" onclick="Button1_Click1"
                        Text="Reply" Width="65px" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
        <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#594B9C" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#33276A" />
    </asp:GridView>


When i click the reply button in the gridview the select row's column value stores the another webform textbox is it possible help me....
Posted
Comments
Sinisa Hajnal 3-Apr-15 4:27am    
Yes, it is possible. For anything more, you'll have to both describe the problem better and post some of your own code that tries to do the work.

You want to open another form when user clicks the button? Which columns should be set into textbox? Which textbox? etc...

You may use
Query Strings,Session variables
 
Share this answer
 
You can bind select cell event in grid view and in code behind of that event, you can access the selected cell value and assign to textbox.
 
Share this answer
 

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