linkbutton

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2008
Posts: 12
Reputation: dilake is an unknown quantity at this point 
Solved Threads: 1
dilake dilake is offline Offline
Newbie Poster

linkbutton

 
0
  #1
Feb 17th, 2009
Programmatically add linkbutton to gridview in asp.net with c#.net
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 104
Reputation: Aneesh_Argent is an unknown quantity at this point 
Solved Threads: 18
Aneesh_Argent Aneesh_Argent is offline Offline
Junior Poster

Re: linkbutton

 
0
  #2
Feb 17th, 2009
Check this code snippet
  1. int rowIndex;
  2. for(rowIndex = 0; rowIndex < myGrdView.Rows.Count; rowIndex++)
  3. {
  4. LinkButton ObjlnkBtn = new LinkButton();
  5. ObjlnkBtn.Text = "Click";
  6. //Let myGrdView.Rows[i].Cells[0].Text contains the item ID
  7. ObjlnkBtn.PostBackUrl = "EditPage.aspx?ID=" + myGrdView.Rows[i].Cells[0].Text;
  8. //Add Link button to the fifth column of each row in the GridView
  9. myGrdView.Rows[i].Cells[5].Controls.Add(ObjlnkBtn);
  10. }
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC