Binding multiple datagrids to the same datasource

J

joe data

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top