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. Advertisements

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:
    382
    Anatoly
    Dec 4, 2003
  2. brian

    Binding Datagrids

    brian, Jan 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    450
    brian
    Jan 29, 2004
  3. Jim Bancroft
    Replies:
    3
    Views:
    2,044
    Bob Weiner
    May 2, 2005
  4. Alexander N. Spitzer
    Replies:
    21
    Views:
    2,174
    Randolf Richardson
    Aug 16, 2004
  5. 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:
    795
    Mr Not So Know It All
    Jan 3, 2007
  6. Vishal

    Get DataGrids DataSource

    Vishal, Jan 19, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    209
    VIshal
    Jan 19, 2005
  7. Jim Bancroft

    binding ArrayLists to DataGrids-- how to name the columns?

    Jim Bancroft, Apr 30, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    301
    Bob Weiner
    May 2, 2005
  8. TJ

    multiple datagrids on same page paging broken

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