When I have a button in RadGrid commanditem as follows:
<CommandItemTemplate>
<div><asp:Button ID="btn_stats" runat="server" Text="Omzet statistieken"></asp:Button></div>
</CommandItemTemplate>
And I want to use that button as RadWindow opener like:
Protected Sub dtgProducts_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
If TypeOf e.Item Is GridCommandItem Then
Dim commandItem As GridCommandItem = CType(e.Item, GridCommandItem)
Dim button As Button = CType(commandItem.FindControl("btn_stats"), Button)
ViewState("statsopener") = button.ClientID
rw_Stats.OpenerElementID = button.ClientID
End If
End Sub
I try to assure the OpenerElementID on paging the RadGrid like:
Protected Sub dtgProducts_PageIndexChanged(sender As Object, e As GridPageChangedEventArgs)
dtgProducts.MasterTableView.Columns(1).HeaderText = ViewState("statsopener")
'dtgProducts.AllowPaging = False
rw_Stats.OpenerElementID = ViewState("statsopener")
End Sub
But the button does not open the RadWindow after paging the grid.
Please assist.
Marc