M
Matt
I see many posts on this topic but still can't find a solution that
works. I'm trying to access a dropdownlist in my datagrid footer when
another dropdownlist in the footer is accessed. The most logical
advice I've seen is to loop thru the controls like this:
Dim myDGItem As DataGridItem
Dim myTextBox As TextBox
For Each myDGItem In DataGrid1.Items
If myDGItem.ItemType = ListItemType.Footer Then
For Each myTextBox In myDGItem.Cells(index).Controls
...
Next
End If
Next
This doesn't work though because it appears the footer isn't part of
the items list. All I get is a type of "item" and "alternating item".
I know the controls exist because I have a subroutine operating on the
selectedindexchange for the dropdownlists. The problem is that when
you capture this event you get a System.EventArgs instead of
DataGridItemEventArgs. Again, I think the problem is that a footer
isn't part of the items list of a datagrid. Here's the prototype for
the subroutine that captures the index change:
Protected Sub ddl_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs)
It's from this sub that I want to access the other dropdownlist in the
footer of the datagrid.
works. I'm trying to access a dropdownlist in my datagrid footer when
another dropdownlist in the footer is accessed. The most logical
advice I've seen is to loop thru the controls like this:
Dim myDGItem As DataGridItem
Dim myTextBox As TextBox
For Each myDGItem In DataGrid1.Items
If myDGItem.ItemType = ListItemType.Footer Then
For Each myTextBox In myDGItem.Cells(index).Controls
...
Next
End If
Next
This doesn't work though because it appears the footer isn't part of
the items list. All I get is a type of "item" and "alternating item".
I know the controls exist because I have a subroutine operating on the
selectedindexchange for the dropdownlists. The problem is that when
you capture this event you get a System.EventArgs instead of
DataGridItemEventArgs. Again, I think the problem is that a footer
isn't part of the items list of a datagrid. Here's the prototype for
the subroutine that captures the index change:
Protected Sub ddl_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs)
It's from this sub that I want to access the other dropdownlist in the
footer of the datagrid.