Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > embedded datagrids
 

embedded datagrids

ASP 1.1, VS 2002, webform!

Hi, I was referred to this forum from ".netaccess and storage" as my problem might be databinding related. I know this is a window forms forum but as I said it was suggested that I raise it here under databinding and there does not appear to be a webform forum.

I have a master/child datagrid. The master datagrid has 2 embedded datagrids derived fromtemplate columns. The datasource for all grids are dataviews and filtering can be applied on the mastergrid. The master grid is paged.

When I load the master grid the embedded grids are populated via the OnItemDataBound method for the first page.

When changing page or selecting a grid item a sub routine isrun which references a session object that stores the original dataview captured during the initial load.The grid is rebound from the dataview in the session object (as far as I can see in the same way as I had originally loaded it). However, the data in the embedded grids are not showing any dataafter these rebound events. I am quite sure the onitemdatabound method fires because I amended the code to write a text value in the target cells and this can be successfully displayed.

I wondered whether viewstate had something to do with it, but then doubted this because, as I say, I could write a text valueinplace of the datagrids. Has anyone any idea what might be wrong?

MAPUK  Wednesday, July 19, 2006 10:32 PM
Ok, I have now resolved this. For some reason the reference to the dataset to build the dataviews was being destroyed when reloading the form on page change or row select. Had to re-reference the dataset object in my reload code.
MAPUK  Thursday, July 20, 2006 3:54 PM
Ok, I have now resolved this. For some reason the reference to the dataset to build the dataviews was being destroyed when reloading the form on page change or row select. Had to re-reference the dataset object in my reload code.
MAPUK  Thursday, July 20, 2006 3:54 PM

You can use google to search for other answers

Custom Search

More Threads

• error: Unbound reference in aggregate expression
• Populating ListBox with data from Access database
• Master/Child relationship in single datagridview
• Moving Up/Down Rows ?
• Binding ToolStripComboBox?
• Duplicate Rows Insereted when DataTable.Rows.Add()
• strange behavior with DataGridViewImageColumn
• DatagridView Databinding Problems when using Parent Combo to Child Combo on row.
• DataGridView Update when filled from Stored Proc
• DataGridView in TabControl and CellValidating lead to problems.