[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Add events to a programmatically created DG

Anna Schmidt

2/28/2004 1:17:00 PM

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