asp.net - How to hide RadToolBarButton from C# -
In my application I'm using two RadToolBarButtons some time I want to hide a RadToolBarButton from C #.
Here I want to hide one first. Save the filter. How to get this RadToolBarButton ID in C #
& Lt; / Item & gt; & Lt; / Telerik: RadToolBar> C #:
Private Zero HideSavefilter () {int CandidatesTableCount = Convert.ToInt32 (. Session ["VendorCandidateListTableCount"] ToString ()); Int candidates RowsCount = Convert.ToInt32 (Sessions ["Seller Code of the list"]. ToString ()); Try {if (CandidatesTableCount & gt; 0 & amp; CandidatesRowsCount> 0) {foreach (bTN in RadToolBarItem CandidatesToolBar.Items) {if (btn.GetType () FullName == "Telerik.Web.UI.RadToolBarButton "& Amp; Amp; btn.Text ==" Save Filter ") {btn.Visible = true; }}} Else if (CandidatesTableCount == 0) {foreach (bTN in RadToolBarItem CandidatesToolBar.Items) {if (btn.GetType () FullName == "Telerik.Web.UI.RadToolBarButton" & amp ;. Amp; btn Text = "Save filter") {btn.Visible = false; }}}}} {}} Please tell me how to do this.
I'm guessing that your bar buttons are wrapped in a right toolbar.
& lt; Telerik: RadToolBar id = "MyRadToolBar" runat = "server" & gt; & Lt; Items & gt; & Lt; Telerik: RadToolBarButton text = "Save filter" tooltip = "Click here to save filter search" CommandName = "SavePopUp" & gt; & Lt; / Telerik: RadToolBarButton & gt; & Lt; Telerik: RadToolBarButton text = "saved filter" tooltip = "click here to see saved search filter" CommandName = "SavedPopUp" & gt; & Lt; / Telerik: RadToolBarButton & gt; & Lt; / Item & gt; & Lt; / Telerik: RadToolBar> Then find and hide items from the text
dim barItem form RadToolBarItem = Me.MyRadToolBar.FindItemByText ("Save Filter") Dim RadButton = CTYPE (BarItem, RadToolBarButton) radButton.Visible = false c #
RadToolBarItem barItem = this.MyRadToolBar.FindItemByText ("Save Filter"); Red Toolbar Button radButton = (RadToolBarButton) bar etam; RadButton.Visible = false;
Comments
Post a Comment