Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Add events to a programmatically created DG

Reply
Thread Tools

Add events to a programmatically created DG

 
 
Anna Schmidt
Guest
Posts: n/a
 
      02-28-2004
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.DataGridSortCommandEvent Handler(this.dg_Sort);
....}

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

Any idea?

thank you

as



 
Reply With Quote
 
 
 
 
Marshal Antony
Guest
Posts: n/a
 
      03-29-2004
Hi Anna,
Here is an article which will help you.
http://www.dotnetjunkies.com/Article...19BA2A575.dcik

Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com




"Anna Schmidt" <(E-Mail Removed)> wrote in message
news:c1q4c2$1l2nle$(E-Mail Removed)-berlin.de...
> 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.DataGridSortCommandEvent Handler(this.dg_Sort);
> ...}
>
> but unfortunately it doesn't work..nothings happens?
>
> Any idea?
>
> thank you
>
> as
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click Events in programmatically created GridView Template =?Utf-8?B?anRlbmNhdGU=?= ASP .Net 0 07-28-2006 08:35 PM
Events not firing in datagrid with programmatically created columns J.ShepherdII@gmail.com ASP .Net Datagrid Control 1 04-17-2006 02:27 PM
Events for programmatically created controls?? how.. Rob Meade ASP .Net 9 08-10-2004 02:40 PM
Programmatically created web user control events Jonas ASP .Net Web Controls 1 08-27-2003 08:17 PM
Programmatically created web user control events Jonas ASP .Net Building Controls 1 08-27-2003 08:17 PM



Advertisments