Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
92 views

Hi,

How to Get the file path of the file which is uploaded via RadChat ToolBar in ClientSide. I tried with this code and it gives me the only file name.

 

 <telerik:RadChat runat="server" ID="RadChat1" Skin="Default" RenderMode="Lightweight">
            <ClientEvents OnToolClick="OnToolClick"  OnLoad="onLoad"/>
            <ToolbarSettings Toggleable="true" Animation="true">
                <AnimationSettings>
                    <ExpandSettings Duration="500" Effects="expandVertical fadeIn" />
                    <CollapseSettings Duration="500" Effects="expandVertical fadeIn" />
                </AnimationSettings>
                <ButtonsCollection>
                    <telerik:ChatToolbarButton Name="UploadImage" IconClass="t-icon t-i-image" />
                </ButtonsCollection>
            </ToolbarSettings>
        </telerik:RadChat>
        <telerik:RadAsyncUpload runat="server" DropZones=".RadChat" AllowedFileExtensions=".bmp,.jpg,.jpeg,.png,.gif" CssClass="chat-upload" ID="RadAsyncUpload1" OnClientFileSelected="OnFileSelected">
        </telerik:RadAsyncUpload>

 

Reference

https://demos.telerik.com/aspnet-ajax/chat/toolbar/defaultcs.aspx

Vessy
Telerik team
 answered on 08 Sep 2021
1 answer
94 views

I have two pages:

a.aspx
b.ascx

The goal is to get the RadToolBarButtons on b.ascx to fire the OnButtonClick() event as defined in the RadToolBar .

a.aspx is the host page for b.ascx and has this placeholder for different RadGrids:

<div id="divMiniGrid" runat="server" visible='<%# ActiveViewID != "viewFees" %>' class="rightPane">
         <sf:PaymentDetailsGrid ID="ctlMiniGrid" runat="server" class="rightPane" Visible="false" IsCondensed="true" />
</div>


b.ascx has the actual RadGrid that is loaded in a.aspx. The RadGrid has an ItemTemplated RadToolbar:

 <telerik:RadGrid ...>
    <MasterTableView ...>
        <CommandItemTemplate>
            <telerik:RadToolBar ... OnButtonClick="PaymentDetailsToolbar_ButtonClick" EnableViewState="true"  onClientButtonClicking="ClientButtonClicking" ...>
                <Items>
                    <telerik:RadToolBarButton runat="server" Text="Edit" ImageUrl="../images/icons/refresh.svg" CommandName="Edit" Enabled="False" />



The PaymentDetailsToolbar_ButtonClick() event lives on b.ascx, but it is never fired when the RadToolBarButton is clicked. Here's the signature:

protected void PaymentDetailsToolbar_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e){...}

The only event that is fired is a.aspx Page_Load() event when the RadToolBarButton is clicked. What's going on?

Attila Antal
Telerik team
 answered on 04 May 2021
2 answers
59 views
Hello, I found some strange behaviour of RadTolBar buttons when disabled by the disable() method. The button is greyed out but still responds to clicking with focus highlight, which will stay until the control is reloaded. You can test it even on the ToolBar demo at https://demos.telerik.com/aspnet-ajax/toolbar/examples/overview/defaultcs.aspx. Just disable a button from the developer console, for example the "Send" one with $find("ctl00_ContentPlaceholder1_RadToolBar1").findItemByText("Send").disable() and then try to click it. Is this behaviour expected or is it a bug? Our customers get confused by it.
Rumen
Telerik team
 answered on 21 Apr 2021
4 answers
219 views

I would prefer to use an SVG for the ImageUrl property of the RadToolBarButton. However, I cannot figure out how to get the RadToolBar to resize the image to match the button/text size.

When I export my SVG to 18px, it is deformed.  But at a larger size, it exports fine.  So, essentially I want to use that larger size, then resize it in the browser (RadToolBarButton).

How do I get the RadToolBar to resize the Image set in the ImageUrl property?

Peter Milchev
Telerik team
 answered on 03 Mar 2021
23 answers
693 views
The following code does not work when the toolbar contains any RadToolBarDropDown objects:

RadToolBar1.Items.FindItemByValue("buttonValue").Visible = true;

It results in the following exception:

Value property is not supported by RadToolBarDropDown
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.Exception: Value property is not supported by RadToolBarDropDown

This makes using it very difficult (indeed impossible).

I note that this has come up before but it seems like the problem is being ignored

 

Peter Milchev
Telerik team
 answered on 07 Dec 2020
1 answer
70 views
Hi ,
     I used three RadToolBarButton with image only in RadToolBar control , how to align all are in center position with Separator.
Screenshot -- http://prntscr.com/tchs0y
Like this -- http://prntscr.com/tchsun

Thanks
M Kumar
Top achievements
Rank 1
Iron
Veteran
 answered on 07 Jul 2020
3 answers
83 views

Hi,

 

For years I used the following code:

 

            Dim dropDown As RadToolBarDropDown = New RadToolBarDropDown("PageSize")
            dropDown.CssClass = "perPageDropDown"
            dropDown.EnableImageSprite = False
            dropDown.Text = GetGlobalResourceObject("Insight", "Per pagina")
            dropDown.ToolTip = GetGlobalResourceObject("Insight", "Per pagina")
            RadFileExplorer1.ToolBar.Items.Add(dropDown)

 

But after upgrading to R1 2020 i get the error:

 

Bericht: Value property is not supported by RadToolBarDropDown

Stack Trace:
at Telerik.Web.UI.RadToolBarDropDown.get_Value() at Telerik.Web.UI.RadFileExplorer.ConfigureToolbarButtons() at Telerik.Web.UI.RadFileExplorer.ControlPreRender() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

Any clues?

Marc

Peter Milchev
Telerik team
 answered on 22 May 2020
3 answers
132 views

Hi!

I am looking for a way to add custom attributes to RadToolbarButton to be rendered in html

When I use following snippet

RadToolBarButton button = new RadToolBarButton();
button.Attributes["data-attr"] = "CustomText";
button.CssClass += "tipsylink";


I expect to see
<a class="tipsylnk ..." data-attr="CustomText"...>

But unfortunately I can see only
<a class="tipsylnk rtbWrap"...>
without data-attr attribute.
I do use jquery to read such attributes from web controls for my custom needs.
And that works for all standard asp.net controls but unfortunately
radtoolbar implementation is different - as I understand it stores
custom attributes in another place.

I know that it is possible to read such attributes on client side using
var toolBar = $find("<%=RadToolBar1.ClientID %>");
var button = toolBar.findItemByText("Button 1");
alert(button.get_attributes().getAttribute("DisplayName"));

but actually I'd like to use standard jquery $('.tipsylnk'). selector
and process all items in the same way.
So is it possible to render custom attributes to html element attribute
for RadToolbarButtons?
Peter Milchev
Telerik team
 answered on 21 Oct 2019
4 answers
178 views
I have a Telerik AJAX Radtoolbar act against a RadGrid. I have code behind to do something when I click items on the ToolBar base on row selected in the grid, but before the post back, I need some client side validation, post back won't happen if validation fails. I tried to use
<telerik:RadToolBar runat="server" Width="100%" ID="RadToolBar1" EnableRoundedCorners="true"  OnClientButtonClicked="javascript:if(!PageValidation()){return false;}"  OnButtonClick="RadToolBar1_ButtonClick" EnableShadows="true" Skin="Office2007" Height="27px" AutoPostBack="false">
                      <Items>
                       <telerik:RadToolBarButton Text="Export" Value="1" PostBack="true" />
                        <telerik:RadToolBarButton IsSeparator="true" />
function PageValidation() {
                var IsValid = false;
                      var error = document.getElementById("errorMsg");
                var mastertableView = $find("<%= RadGrid1.MasterTableView.ClientID %>");
                 var count = mastertableView.get_selectedItems().length;
                    if (count < 1) {
                                 error.style.display = "inherit";
                        IsValid = false;
                    }
                    else {
                         error.style.display = "none";
                        IsValid = true;
                    }
                 
                return IsValid;
 
            }
However, this causes the RadToolBar unclickable and even jam all other AJAX functions on the page. if I changed the OnClientClicked to "OnClientButtonClicked="PageValidation" ", the client side validation works with the error msg pop up but it cannot stop the post back.

Are there any other ways that I can work around or did I miss something using this method?

Thanks!
Peter Milchev
Telerik team
 answered on 21 Aug 2019
1 answer
256 views

Hi ,  How to Enable/Disable radtoolbar from client side ?
i am used jquery like below , but not disabled.

var rtbar = $find("ctl00_ContentPlaceHolder1_Searchbar");

 if (SelectedName == "False") {
        $("#rtbar").attr("disabled", true);
         //   $("#rtbar").prop("disabled", true);
       // $("#rtbar").attr("style", "disabled:true;");
    }
    else {
       $("#rtbar").removeAttr('disabled');
        // $("#rtbar").attr("disabled", false);
        //$("#rtbar").attr("style", "disabled:false;");
    }

Thanks
 
   

Rumen
Telerik team
 answered on 17 Apr 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?