Total Pageviews

Wednesday, May 20, 2009

Dynamic Add Controls in row of Grid View

just use following line to add row control in particular cell or row of gridview......

  // here i m adding textbox to gridview 
  TextBox textBox = new TextBox(); 
  textBox.ID = "txt" + columnName; 
  gvGeneratedTemplate2.Rows[0].Cells[i].Controls.Add(textBox);  
  
  // gvGeneratedTemplate2 this is my gridview id  same as u can add more control to grid view depending grid view's indexs.......................
  

No comments:

Post a Comment

Blog Archive

Ideal SQL Query For Handling Error & Transcation in MS SQL

BEGIN TRY BEGIN TRAN --put queries here COMMIT; END TRY BEGIN CATCH IF @@TRANCOUNT>0 BEGIN SELECT @@ERROR,ERRO...