linkbutton in datagrid??

Last post 07-07-2009 12:20 AM by Bhaarat. 5 replies.

Sort Posts:

  • linkbutton in datagrid??

    06-30-2009, 10:37 PM
    • Member
      15 point Member
    • .net_junkie
    • Member since 05-21-2009, 10:57 AM
    • Posts 213

    hi i have taken datagrid to display data like username password price in the last column i have added viewdetails linkbutton if i click on the link button i have to see particular row only shall i take another datagrid to display the data or can i display in the same datagrid with all rows hidden any ideas??thanks.

    It is not about what caused you to fall flat on your back that defines you; it is what you do to get back up on your feet.
  • Re: linkbutton in datagrid??

    06-30-2009, 10:51 PM
    • Contributor
      2,674 point Contributor
    • anup1252000
    • Member since 11-12-2008, 8:26 AM
    • india
    • Posts 541

    I m not able to understand your question.. can u plz tell in simplier way..

    Remember to click “Mark as Answer” on the post, if it helps you. Because It helps others to find the solution.

    Anup Hosur
    HP
    http://anup-anuphosur.blogspot.com/


  • Re: linkbutton in datagrid??

    07-01-2009, 4:17 AM
    • Member
      15 point Member
    • .net_junkie
    • Member since 05-21-2009, 10:57 AM
    • Posts 213

    i have taken linkbutton in datagrid and when i click it i want to display particular data in that row hw can i display it?? i wan to display the data in another data grid how to do it.

    It is not about what caused you to fall flat on your back that defines you; it is what you do to get back up on your feet.
  • Re: linkbutton in datagrid??

    07-01-2009, 4:26 AM
    Answer
    Regards
    Ravi
    Please click "mark as answer" if this post helped you.
  • Re: linkbutton in datagrid??

    07-07-2009, 12:08 AM
    Answer

     Hi .net_junkie,

        protected void dg_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            string str = dg.DataKeys[e.Item.ItemIndex].ToString();
            string sql = "select * from table where id = " + str;
            //query database and bind the resultset to another datagrid
    
        }


     

         <asp:DataGrid DataKeyField="Id" runat="server" ID="dg" OnItemCommand="dg_ItemCommand" >
             <Columns>
                 <asp:TemplateColumn>
                     <ItemTemplate>
                         <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
                     </ItemTemplate>
                 </asp:TemplateColumn>
             </Columns>
         </asp:DataGrid>



    Samu Zhang
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: linkbutton in datagrid??

    07-07-2009, 12:20 AM
    • Participant
      1,310 point Participant
    • Bhaarat
    • Member since 01-03-2007, 5:05 AM
    • India
    • Posts 367

    or for more better look

    1. you may use .. collapsible Panel inside Gridview...so whn you will click on your button your hiddne Data will appear in ver smoothly...without postback...
    2. secondly you can use Nested Gridview.. or any other control in Gridview

    Refer this http://www.codeproject.com/KB/aspnet/EditNestedGridView.aspx


    All The Best



    Bhaarat


    Remember to click "Mark as Answer" on the post that helps U

    My Blog
Page 1 of 1 (6 items)