My ASP.NET Web Form has a RadTabStrip with 3 different tabs. The first tab has the username and password, the second tab has the permissions, and the third tab has the clients. The username and password have RequiredFieldValidators on them.
I have noticed that whenever I go from one tab to another, the Windows TextBox Control txtPassword's Text field is getting reset, causing the page to not validate whenever tabs 2 or 3 are shown.
I created a hack to fix this:
Protected Sub RadTabStrip1_ClientTabSelecting(sender As Object, e As RadTabStripEventArgs) Handles RadTabStrip1.TabClick
Page.Validate()
If Me.IsValid() Then
If Not String.IsNullOrWhiteSpace(txtPassword.Text) Then
ViewState("password") = txtPassword.Text
End If
Else
If String.IsNullOrWhiteSpace(txtPassword.Text) Then
txtPassword.Text = ViewState("password")
End If
If String.IsNullOrWhiteSpace(txtConfirmPassword.Text) Then
txtConfirmPassword.Text = ViewState("password")
End If
Page.Validate()
If Not IsValid() Then
MultiView1.ActiveViewIndex = 1
RadTabStrip1.SelectedIndex = 0
RadMultiPage1.SelectedIndex = 0
End If
End If
End Sub
I do not like storing their password in the ViewState, but it works.
Almost.
The Submit button is on the bottom of the page, contained within a RadToolBar.
Protected Sub RadToolBar1_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs) Handles RadToolBar1.ButtonClick
Dim rb As Telerik.Web.UI.RadToolBarButton = e.Item
Dim clientList As List(Of Client) = ViewState("MyClientList")
If rb.CommandName = "Save" Then
There is a breakpoint on that line of code, but Validation fails before that code is reached.
By this point, my customers are on Tab 3, and they have no way to tell that the txtPassword control has had their input deleted on Tab 1.
Has anyone ever experienced a Windows Control like this password getting cleared whenever the RadTabStrip Index changes?
How do I fix this?
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.