skip navigation
Telerik UI for ASP.NET AJAX
Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
NEW
: Design Kits for Figma
Online Training
Document Processing Library
Embedded Reporting for web and desktop
Web
Kendo UI
UI for jQuery
UI for Angular
UI for React
UI for Vue
UI for Blazor
UI for ASP.NET Core
UI for ASP.NET MVC
UI for ASP.NET AJAX
UI for Silverlight
UI for PHP
UI for JSP
Mobile
UI for .NET MAUI
UI for Xamarin
Document Management
Telerik Document Processing
Desktop
UI for .NET MAUI
UI for WinUI
UI for WinForms
UI for WPF
UI for UWP
Reporting & Mocking
Telerik Reporting
Telerik Report Server
Telerik JustMock
Automated Testing
Test Studio
Test Studio Dev Edition
CMS
Sitefinity
UI/UX Tools
ThemeBuilder
Design System Kit
Debugging
Fiddler
Fiddler Everywhere
Fiddler Classic
Fiddler Jam
FiddlerCap
FiddlerCore
Extended Reality
UI for Unity XR
Free Tools
JustAssembly
JustDecompile
VB.NET to C# Converter
Testing Framework
View all products
Overview
Demos
Roadmap
What's New
Roadmap
Release History
Docs & Support
Pricing
Search
Shopping cart
Login
Contact Us
Try now
close mobile menu
Telerik Forums
/
UI for ASP.NET AJAX
This is a migrated thread and some comments may be shown as answers.
This may be really simple...
2 Answers
47 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Ciaran
Top achievements
Rank 1
Ciaran
asked on
09 Jan 2009,
12:50 PM
but its annoying the hell out of me right now
I simply need the text value of a rad toolbar item
I have no problem doing what I need in the ButtonClick event but I need the value based on other events on the page
any ideas?
Radtoolbar1.item.text doesnt do it for me
Add a comment
Submit comment
Cancel
2 Answers
, 1 is accepted
Sort by
Score
Date
0
Princy
Top achievements
Rank 2
answered on
12 Jan 2009,
11:10 AM
Hello Ciaran,
I tried the following code to get the text of a RadToolBar item and it worked as expected.
aspx:
<
telerik:RadToolBar
ID
=
"RadToolBar1"
Width
=
"1000px"
runat
=
"server"
>
<
Items
>
<
telerik:RadToolBarButton
Text
=
"Text1"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
Text
=
"Text2"
CssClass
=
"Button"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
Text
=
"Text3"
CssClass
=
"Button"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
Text
=
"Text4"
CssClass
=
"Button"
>
</
telerik:RadToolBarButton
>
</
Items
>
</
telerik:RadToolBar
>
cs:
protected void Page_Load(object sender, EventArgs e)
{
string
strtxt
=
RadToolBar1
.Items
[0]
.Text;
}
Thanks
Princy.
Add a comment
Submit comment
Cancel
0
Peter
Telerik team
answered on
12 Jan 2009,
11:24 AM
Hello,
Indexing the Items collection is one possible way to do this. Alternatively, you can use the
FindItemByValue
/Text/Attribute methods. Here is a simple example:
<
telerik:RadToolBar
ID
=
"RadToolBar1"
runat
=
"server"
>
<
CollapseAnimation
Type
=
"OutQuint"
Duration
=
"200"
>
</
CollapseAnimation
>
<
Items
>
<
telerik:RadToolBarButton
runat
=
"server"
Value
=
"A"
Text
=
"Button 0"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Value
=
"B"
Text
=
"Button 1"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Value
=
"C"
Text
=
"Button 2"
>
</
telerik:RadToolBarButton
>
</
Items
>
</
telerik:RadToolBar
>
C#
Page_Load(
object
sender, System.EventArgs e)
{
Response.Write(RadToolBar1.Items.FindItemByValue(
"A"
).Text);
}
VB.NET
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
Response.Write(RadToolBar1.Items.FindItemByValue(
"A"
).Text)
End
Sub
Peter
the Telerik team
Check out
Telerik Trainer
, the state of the art learning tool for Telerik products.
Add a comment
Submit comment
Cancel
Answer this question
Drag and drop files here or
browse
to attach...
Browse
for files to attach...
Supported file types: PNG, JPG, JPEG, ZIP, RAR, TXT. Max total file size - 20MB.
Submit answer
Cancel
Tags
ToolBar
Asked by
Ciaran
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Peter
Telerik team
Share this question
or
Copy link