RE: Hi, I was asked this in an Interview I want to add...
Hi Yatin
to added controls to the footer of the datagrid we use <footer Template> </footer template> command in <template columns> </template colums>. For example we a button control in a footer of datagrid like this:
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?
You can add the controls in the footer similar to the way how you add a control for a column. If you want to add the control in the footer you should take template field. In the template field you will be having footer template. Just drag and drop the control which ever you like.
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.