Add events to a programmatically created DG

Discussion in 'ASP .Net Web Controls' started by Anna Schmidt, Feb 28, 2004.

  1. Anna Schmidt

    Anna Schmidt Guest

    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
    Anna Schmidt, Feb 28, 2004
    #1
    1. Advertising

  2. Hi Anna,
    Here is an article which will help you.
    http://www.dotnetjunkies.com/Article/CEEE5469-58F8-4895-8822-76119BA2A575.dcik

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




    "Anna Schmidt" <> wrote in message
    news:c1q4c2$1l2nle$-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.DataGridSortCommandEventHandler(this.dg_Sort);
    > ...}
    >
    > but unfortunately it doesn't work..nothings happens?
    >
    > Any idea?
    >
    > thank you
    >
    > as
    >
    >
    >
    Marshal Antony, Mar 29, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Meade
    Replies:
    9
    Views:
    567
    Rob Meade
    Aug 10, 2004
  2. =?Utf-8?B?anRlbmNhdGU=?=

    Click Events in programmatically created GridView Template

    =?Utf-8?B?anRlbmNhdGU=?=, Jul 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    797
    =?Utf-8?B?anRlbmNhdGU=?=
    Jul 28, 2006
  3. Jonas

    Programmatically created web user control events

    Jonas, Aug 27, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    196
    Lucas Tam
    Aug 27, 2003
  4. Replies:
    1
    Views:
    327
    Teemu Keiski
    Apr 17, 2006
  5. Jonas

    Programmatically created web user control events

    Jonas, Aug 27, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    148
    Lucas Tam
    Aug 27, 2003
Loading...

Share This Page