I am currently enabling and disabling my radtoolbar commanditems (for my radgrid) on the serverside with the following code. This is working fine but requires a postback to the server which is too slow (2 secs before buttons update).
Serverside code (VB):
I have been trying to change this over to be done on the client side (in the rowselected event) instead to make it more responsive, but I have been unable to find a clientside method of accessing these buttons as they are nested inside the radgrid commanditem toolbar.
Serverside code (VB):
Protected Sub radGrid_Cases_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) |
For Each cmdItem As GridCommandItem In radGrid_Cases.MasterTableView.GetItems(GridItemType.CommandItem) |
Dim rdtlbr As RadToolBar = DirectCast(cmdItem.FindControl("rtb_Commands"), RadToolBar) |
rdtlbr.FindItemByText("Edit Case").Enabled = True |
rdtlbr.FindItemByText("Delete Case").Enabled = True |
rdtlbr.FindItemByText("Print Case").Enabled = True |
rdtlbr.FindItemByText("Email Case").Enabled = True |
rdtlbr.FindItemByText("Edit Payments").Enabled = True |
Next |
End Sub |
Public Sub DisableGridCommandButtons() |
For Each cmdItem As GridCommandItem In radGrid_Cases.MasterTableView.GetItems(GridItemType.CommandItem) |
Dim rdtlbr As RadToolBar = DirectCast(cmdItem.FindControl("rtb_Commands"), RadToolBar) |
rdtlbr.FindItemByText("Edit Case").Enabled = False |
rdtlbr.FindItemByText("Delete Case").Enabled = False |
rdtlbr.FindItemByText("Print Case").Enabled = False |
rdtlbr.FindItemByText("Email Case").Enabled = False |
rdtlbr.FindItemByText("Edit Payments").Enabled = False |
Next |
End Sub |
I have been trying to change this over to be done on the client side (in the rowselected event) instead to make it more responsive, but I have been unable to find a clientside method of accessing these buttons as they are nested inside the radgrid commanditem toolbar.