Hello,
I have the following Toolbar. Depending on conditions that are evaluated in the databound event of a formview named "fv_ProjectData", I want to enable/disable some buttons. The problem is, that the buttons aren“t updated. The databound event fires as expected and the visible properties of the toolbar buttons are set correctly. But the buttons are updated only when clicking for example another button. What settings in the Ajax Manager are necessary that the formview updates the buttons.
Any ideas ?
Robert
I have the following Toolbar. Depending on conditions that are evaluated in the databound event of a formview named "fv_ProjectData", I want to enable/disable some buttons. The problem is, that the buttons aren“t updated. The databound event fires as expected and the visible properties of the toolbar buttons are set correctly. But the buttons are updated only when clicking for example another button. What settings in the Ajax Manager are necessary that the formview updates the buttons.
Any ideas ?
Robert
<telerik:RadToolBar ID="rtb_DataButtons" runat="server" OnClientButtonClicking="ClientButtonClicking" OnButtonClick="rtbDataButtons_ButtonClick" AutoPostBack="True"> |
<Items> |
<telerik:RadToolBarButton runat="server" Value="New" Text="New" ImageUrl="~/img/AddRecord.gif" CommandName="New"> |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton runat="server" Value="Save" Text="Save" ImageUrl="~/img/Update.gif" CommandName="Save" > |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton runat="server" Value="Edit" Text="Edit" ImageUrl="~/img/Edit.gif" CommandName="Edit"> |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton runat="server" Value="Cancel" Text="Cancel" ImageUrl="~/img/Cancel.gif" CommandName="Cancel" CausesValidation="False"> |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton runat="server" Value="Delete" Text="Delete" ImageUrl="~/img/Delete.gif" CommandName="Delete" CausesValidation="False"> |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton runat="server" Value="Separator_1" IsSeparator="true"> |
</telerik:RadToolBarButton> |
<telerik:RadToolBarButton runat="server" Value="Print" Text="Print" ImageUrl="~/img/Print.gif" CommandName="Print"> |
</telerik:RadToolBarButton> |
</Items> |
</telerik:RadToolBar> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" > |
<AjaxSettings > |
<telerik:AjaxSetting AjaxControlID="fv_ProjectData"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="fv_ProjectData"></telerik:AjaxUpdatedControl> |
<telerik:AjaxUpdatedControl ControlID="rtb_DataButtons"></telerik:AjaxUpdatedControl> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
Protected Sub fvProject_Databound(ByVal sender As Object, ByVal e As EventArgs) |
<.. some code ...> |
SetControls(sender) |
End Sub |
Sub SetControls(ByVal aFormview As FormView) |
If aFormview Is Nothing Then |
ToolbarBtn_New.Visible = True |
ToolbarBtn_Edit.Visible = False |
ToolbarBtn_Save.Visible = False |
ToolbarBtn_Cancel.Visible = False |
ToolbarBtn_Delete.Visible = False |
ToolbarBtn_Separator1.Visible = False |
ToolbarBtn_Print.Visible = False |
Else |
With aFormview |
ToolbarBtn_New.Visible = (.CurrentMode = FormViewMode.ReadOnly) |
ToolbarBtn_Edit.Visible = (.CurrentMode = FormViewMode.ReadOnly) |
ToolbarBtn_Save.Visible = ((.CurrentMode = FormViewMode.Edit) Or (.CurrentMode = FormViewMode.Insert)) |
end with |
end if |