I created the following function for my grid that runs on the PreRender event
however, this causes a problem when I use the export to Excel feature as I believe it tried to run this code when doing the export.
Is there a way to make sure this code is NOT run during export? I'm looking for something like an IfIsExporting then don't run it, else run it feature. Thanks.
Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs) |
queueFilter = Request.QueryString("queue") |
For Each item As GridDataItem In RadGrid1.MasterTableView.Items |
Dim TaskID As String = item("TaskID").Text |
If TaskID = " " Then |
Dim cell As TableCell = item.Item("ExpandColumn") |
Dim expandCollapseButton As Button = CType(cell.Controls(0), Button) |
expandCollapseButton.Visible = False |
ElseIf queueFilter = "My Requests" Then |
item.Expanded = True |
End If |
Next |
End Sub |
however, this causes a problem when I use the export to Excel feature as I believe it tried to run this code when doing the export.
Is there a way to make sure this code is NOT run during export? I'm looking for something like an IfIsExporting then don't run it, else run it feature. Thanks.