Add events to a programmatically created DG

A

Anna Schmidt

Hello,

I have a programmatically created datagrid (no def in the aspx-file)


dg2.DataBind();
holder.Controls.Add(dg2); // placeholder


in the method InitializeComponent i want to add events (sorting paging) etc.
to this Datagrid dg2:

private void InitializeComponent()
{
this.dg2.SortCommand += new
System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.dg_Sort);
....}

but unfortunately it doesn't work..nothings happens?

Any idea?

thank you

as
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top