Hi,
I have a user control which contains a GridView. The user control is supposed to hide/show depending on whether or not there is any data in the GridView. In the GridView RowDataBound event, I do the following:
This code does not work in that the Me.Visible = True line is not being performed. I have set a breakpoint on that line and after the line executes, Me.Visible is still False. How can that be? Is it getting confused with the parent page or something? Not sure what's going on here.
Yes, ShowFooter is set to true and this line of code IS executing, just not changing the property value. I've tried to use a panel and just showing/hiding that, but the exact same thing happens.
I have a user control which contains a GridView. The user control is supposed to hide/show depending on whether or not there is any data in the GridView. In the GridView RowDataBound event, I do the following:
Code:
If e.Row.RowType = DataControlRowType.DataRow Then
'Do stuff
ElseIf e.Row.RowType = DataControlRowType.Footer Then
'Do more stuff.
[b]Me.Visible = True[/b]
ElseIf e.Row.RowType = DataControlRowType.EmptyDataRow Then
[b]Me.Visible = False[/b]
End If
This code does not work in that the Me.Visible = True line is not being performed. I have set a breakpoint on that line and after the line executes, Me.Visible is still False. How can that be? Is it getting confused with the parent page or something? Not sure what's going on here.
Yes, ShowFooter is set to true and this line of code IS executing, just not changing the property value. I've tried to use a panel and just showing/hiding that, but the exact same thing happens.