Click here to Skip to main content
15,924,196 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralBandObject Help Pin
Member 165616027-Jan-05 12:13
Member 165616027-Jan-05 12:13 
GeneralRe: BandObject Help Pin
Dave Kreskowiak28-Jan-05 3:42
mveDave Kreskowiak28-Jan-05 3:42 
Generalcreate word application in vb.net Pin
Member 162996427-Jan-05 11:02
Member 162996427-Jan-05 11:02 
GeneralSuppressing Save as Dialog box Pin
Anonymous27-Jan-05 10:58
Anonymous27-Jan-05 10:58 
Generalbound listbox duplicates displaymember after edit Pin
Mark Payton27-Jan-05 10:45
Mark Payton27-Jan-05 10:45 
GeneralRounding Pin
superprogrammingdude27-Jan-05 10:25
superprogrammingdude27-Jan-05 10:25 
GeneralRe: Rounding Pin
Dave Kreskowiak27-Jan-05 10:37
mveDave Kreskowiak27-Jan-05 10:37 
GeneralCheckBoxes in Detail of Master/Detail Datagrid Pin
dhorne4127-Jan-05 9:56
dhorne4127-Jan-05 9:56 
Hi. I am creating a Master/Detail DataGrid page and have run into a problem that I just haven't been able to work through. I have successfully created the Master and Detail DataGrids and they display correctly, however, I need to be able to access Checkboxes that I have added to the Detail datagrid.

The layout is as follows. The page is for selecting Training classes that you would like to register for. The DataGrids are both populated using SQL queries and the data is pulled from an Access database. The Master datagrid contains the months for the training schedule. The Detail datagrid contains the schedule of classes. Next to each Class name in teh Detail DataGrid is a checkbox. The Datagrids are enclosed in a Form with a Register button at the bottom.

The user needs to be able to check the boxes of the classes they would like to take and click the Register button.

Now, I had the site working before I created the Master and Detail grids. It was originally one Datagrid. Clicking Register checks to see which checkboxes are checked using a For...Each loop and finding the checkbox controlls in the current DataGrid. It then populates a Datatable with the data from that row (Declared in a Public Property) and passes it to a second page using Server.Transfer to allow the user to enter registration information and confirm selected classes.

The problem came when I created the Detail datagrid. I can no longer iterate through the checkbox controls in the detail datagrid. I am receiving errors when trying to access the internal datagrid. Here is the error

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 112: Dim inDataGridItem As DataGridItem
Line 113: Dim chkClassSelect As System.Web.UI.WebControls.CheckBox
Line 114: Dim dgNestedSchedule As DataGrid = CType(oDataGridItem.FindControl("dgSchedule"), DataGrid)


I don't get the error until the Register button is actually clicked. The Detail Datagrid is being created using ITemplate from a UserControl file so it is being dynamically added to the first cell of the Master grid.

I have tried resolving in a number of different ways, including trying with and without casting. I am using the FindControls method to locate dgSchedule (the detail grid) within the current cell of dgClasses (the master grid displaying the months). But I still receive this error. How do I go about iterating through checkboxes in the nested grid?

Thanks,

Dustin Horne

GeneralInstall windows service application Pin
leezardd27-Jan-05 9:07
leezardd27-Jan-05 9:07 
GeneralRe: Install windows service application Pin
Dave Kreskowiak27-Jan-05 10:34
mveDave Kreskowiak27-Jan-05 10:34 
GeneralRe: Install windows service application Pin
leezardd28-Jan-05 5:09
leezardd28-Jan-05 5:09 
QuestionCommand execute??? Pin
charleslau285527-Jan-05 4:25
charleslau285527-Jan-05 4:25 
AnswerRe: Command execute??? Pin
Dave Kreskowiak27-Jan-05 4:52
mveDave Kreskowiak27-Jan-05 4:52 
Generalpopulate list view in VB from VC++ dll using SendMessage Api Pin
Mohamed Jaffar Sagir26-Jan-05 23:35
Mohamed Jaffar Sagir26-Jan-05 23:35 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
Dave Kreskowiak27-Jan-05 4:41
mveDave Kreskowiak27-Jan-05 4:41 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
rwestgraham30-Jan-05 18:02
rwestgraham30-Jan-05 18:02 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
Dave Kreskowiak31-Jan-05 1:22
mveDave Kreskowiak31-Jan-05 1:22 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
rwestgraham31-Jan-05 6:53
rwestgraham31-Jan-05 6:53 
GeneralRe: populate list view in VB from VC++ dll using SendMessage Api Pin
Dave Kreskowiak31-Jan-05 7:13
mveDave Kreskowiak31-Jan-05 7:13 
GeneralUsing htmldocument Pin
pnprashanth26-Jan-05 18:08
pnprashanth26-Jan-05 18:08 
Generalhelp with using a button click to Pin
bean:)26-Jan-05 16:43
bean:)26-Jan-05 16:43 
GeneralRe: help with using a button click to Pin
Dave Kreskowiak27-Jan-05 3:45
mveDave Kreskowiak27-Jan-05 3:45 
GeneralRe: icons on context menu Pin
Heath Stewart26-Jan-05 15:08
protectorHeath Stewart26-Jan-05 15:08 
Generalbussiness project Pin
Anonymous26-Jan-05 11:29
Anonymous26-Jan-05 11:29 
GeneralRe: bussiness project Pin
Dave Kreskowiak27-Jan-05 3:43
mveDave Kreskowiak27-Jan-05 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.