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
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:
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?
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?
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
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
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 onlywithout data-attr attribute.<
a
class
=
"tipsylnk rtbWrap"
...>
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
but actually I'd like to use standard jquery $('.tipsylnk'). selector
var
toolBar = $find(
"<%=RadToolBar1.ClientID %>"
);
var
button = toolBar.findItemByText(
"Button 1"
);
alert(button.get_attributes().getAttribute(
"DisplayName"
));
and process all items in the same way.
So is it possible to render custom attributes to html element attribute
for RadToolbarButtons?
<
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;
}
OnClientButtonClicked
=
"PageValidation"
", the client side validation works with the error msg pop up but it cannot stop the post back. 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