Binding multiple datagrids to the same datasource

Discussion in 'ASP .Net Datagrid Control' started by joe data, Apr 27, 2004.

  1. joe data

    joe data Guest

    I need to bind multiple datagrids to the same list of objects.

    // Bind to datagrids
    // Where l_objSchedules is an ArrayList of objects
    dgViewScheduleFuture.DataSource = l_objSchedules;
    dgViewScheduleFuture.DataBind();

    dgViewSchedule.DataSource = l_objSchedules;
    dgViewSchedule.DataBind();

    I would like to be able to setup an Itemdatabound event for each data grid
    so I can process the lists individually and determine which grid they need
    to be placed into.
    // datagrid event handlers
    dgViewScheduleFuture.ItemDataBound +=new
    DataGridItemEventHandler(dgViewScheduleFuture_ItemDataBound);
    dgViewSchedule.ItemDataBound +=new
    DataGridItemEventHandler(dgViewSchedule_ItemDataBound);

    Currently I am only receiving all the ItemdataBound event for the
    dgViewScheduleFuture datagrid. I only receive header and footer events for
    the second datagrid. It appears that the data grid that binds first is the
    only one to receive all the events. Does anybody know if it is possible to
    bind grids in this manners or is there a more effecient technique to use.

    thanks in advance
    joe data, Apr 27, 2004
    #1
    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. Eldon Ferran de Pol

    Binding Datagrids To a collection

    Eldon Ferran de Pol, Dec 4, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    314
    Anatoly
    Dec 4, 2003
  2. brian

    Binding Datagrids

    brian, Jan 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    366
    brian
    Jan 29, 2004
  3. Mr Not So Know It All

    Binding multiple Datasource to DropDownlist

    Mr Not So Know It All, Jan 3, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    701
    Mr Not So Know It All
    Jan 3, 2007
  4. Vishal

    Get DataGrids DataSource

    Vishal, Jan 19, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    115
    VIshal
    Jan 19, 2005
  5. TJ

    multiple datagrids on same page paging broken

    TJ, Jun 15, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    140
    Walter Wang [MSFT]
    Jun 16, 2006
Loading...

Share This Page