GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Microsoft  >  DataGrid

 Print  |  
Question:  Hi, I was asked this in an Interview I want to add buttons,images,etc to the footer of a datagrid at runtime. how would i achieve this?



June 06, 2009 09:34:49 #4
 albu77   Member Since: September 2007    Total Comments: 8 

RE: Hi, I was asked this in an Interview I want to add buttons,images,etc to the footer of a datagrid at runtime. how would i achieve this?
 
As they ask you to do it at run time, you need to add the controls to the control collection of the cell of the footer row of the gridView.
Button myBtn = new Button();

gvTest.FooterRow.Cells[1].Controls.Add(myBtn);

Play caution where the dynamic addition is done if you want it to persist.

     

 

Back To Question