Thursday, September 8, 2011

Dynamically add controls to footer row using RowTemplate

Create a Class that inherits ITemplate and add controls the container ; you want to add.

Assign the object of that class to ASPxGridView Templates.FooterRow property as:
 
ASPxGridView1.Templates.FooterRow = new CustomFooterRowTemplate();
 
And the code snippet of the template class is below:
 
public class CustomFooterRowTemplateITemplate
        {
            
            void ITemplate.InstantiateIn(Control container)
            {
                Button button = new Button();
                button.Text = "Test";
                container.Controls.Add(button);
            }
        }

have an idea from this and you can add more controls and even you can use their
their event handler in the custom template except using on the rowcommand event.