943,777 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1386
  • ASP.NET RSS
Feb 17th, 2009
0

linkbutton

Expand Post »
Programmatically add linkbutton to gridview in asp.net with c#.net
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
dilake is offline Offline
27 posts
since Jan 2008
Feb 17th, 2009
0

Re: linkbutton

Check this code snippet
ASP.NET Syntax (Toggle Plain Text)
  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. }
Reputation Points: 16
Solved Threads: 18
Junior Poster
Aneesh_Argent is offline Offline
104 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: problem in the login code
Next Thread in ASP.NET Forum Timeline: control hierarchy





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC