This is a migrated thread and some comments may be shown as answers.

Using client side code

6 Answers 199 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
cayates
Top achievements
Rank 1
cayates asked on 17 Aug 2009, 03:09 PM
Hello, I'm trying to use client side code, however, whenever I add a client side event I get this javascript error:

Telerik.Web.UI.RadListBox is undefined

I've tried using RegisterWithScriptManager, that didn't help.  My script manager is in a master page file, if that makes a difference.

Please help, thanks.


6 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 17 Aug 2009, 03:27 PM
Hello cayates,

Please post here some relevant code so we can try to find where is the problem.

Best wishes,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
cayates
Top achievements
Rank 1
answered on 17 Aug 2009, 04:45 PM
One other thing is that it's inside the form template of a RadGrid, which may make a difference.

<EditFormSettings EditFormType="Template"
                                <FormTemplate> 
                                    <table class="formRow"
                                        <tr style="height: 36px;"
                                            <td class="inputFieldLeft"
                                                <div class="inputFieldLabel">Type</div> 
                                                <telerik:RadListBox ID="ParticipantType" runat="server" Width="160" Height="150" 
                                                    CheckBoxes="true" DataSourceID="ParticipantTypes" DataTextField="Name" DataValueField="Value" 
                                                    /> 
                                            </td> 
0
Veselin Vasilev
Telerik team
answered on 18 Aug 2009, 08:59 AM
Hello cayates,

I cannot see any client-side events nor javascript code.

The more information you share with us - the faster resolution for you.

Kind regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Shinu
Top achievements
Rank 2
answered on 18 Aug 2009, 09:18 AM
Hi,

Inorder to access the RadListBox in a client event, you can try using the following code:

js:
var listbox = $telerik.findElement($get("RadGrid1"), "ParticipantType");

-Shinu.
0
John Banian
Top achievements
Rank 1
answered on 23 Apr 2010, 05:01 PM
ASP.NET->RadGrid-><FormTemplate>.->RadListBox  with CheckBoxes="true"

I am using RadListBox  with CheckBoxes="true" inside RadGrid <FormTemplate>.

I am using ObjectDataSource to bind the data to RadListBox.
Queries:
1. How to retrive checked values from the RadListBox  which is inside
<FormTemplate> from Codebehind using c#..
2. How to set the checkboxes checked using the saved Table values  from Codebehind using c#.
3. I did not bind RadListBox to RadGrid Columns.  I am not using DataField property to bind to RadListBox.

Do you have any sample codes?

<EditFormSettings EditFormType="Template"> 
                                <FormTemplate> 
                                    <table class="formRow"> 
                                        <tr style="height: 36px;"> 
                                            <td class="inputFieldLeft"> 
                                                <div class="inputFieldLabel">Type</div> 
                                                <telerik:RadListBox ID="ParticipantType" runat="server" Width="160" Height="150" 
                                                    CheckBoxes="true" DataSourceID="ParticipantTypes" DataTextField="Name" DataValueField="Value" 
                                                    /> 
                                            </td> 

0
Genady Sergeev
Telerik team
answered on 28 Apr 2010, 02:06 PM
Hi John Banian,

As an attachment you can find sample project that demonstrates:

1) how to obtain the RadListBox's checked items
2) how to check RadListBox items using C#.

Kind regards,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ListBox
Asked by
cayates
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
cayates
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
John Banian
Top achievements
Rank 1
Genady Sergeev
Telerik team
Share this question
or