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

Always first Item is Selected

9 Answers 190 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Santosh Kannan
Top achievements
Rank 1
Santosh Kannan asked on 09 Jun 2010, 11:55 AM
Hi,

I implemented a cascading dropdown exactly like in this example multiplecomboboxes

The issue im facing is that the SelectedItem in ServerSide code is always the first item in the ComboBox. No matter which item is selected the SelectedItem is always the first item in the ComboBox. In the javascript though the selecteditem is captured correctly.

The values are confirmed to be unique values.

I am using the Radcontrols version 2010.1 519
Kindly advice how to resolve this issue.



9 Answers, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 10 Jun 2010, 11:21 AM
Hello Santosh,

The SelectedItem property should work as expected, but it is possible that there is something specific to your approach that prevents it from working. Can you please open a support ticket and send us a sample project so we can inspect your code and advise you on how to resolve the problem.

Sincerely yours,
Dimitar Milushev
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.
0
Santosh Kannan
Top achievements
Rank 1
answered on 15 Jun 2010, 02:33 AM
This happens in MOSS environment. I am unable to create a sample project since it is in Sharepoint environment.

Please advice.

Thanks.
0
Simon
Telerik team
answered on 15 Jun 2010, 10:02 AM
Hello Santosh Kannan,

We would be unable to help you unless we see at least the code that involves the RadComboBoxes.

Could you please either paste it here or open a support ticket and send us the Web Part which holds the RCBs? (Please include all code which is related to the RCBs.)

Sincerely yours,
Simon
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.
0
Santosh Kannan
Top achievements
Rank 1
answered on 21 Jun 2010, 04:01 AM
Hi Dimitar & Simon,

I did raise a support ticket and there is no response yet. Anyway i will post the details here as well and please do help to resolve the issue. Support Ticket ID: 319800 has sample code.

I am facing these issues when using RadComboBox in sharepoint environment,

Issue 1:

When the RADComboBox has its DataSourceID property set, i have a Default Item and AppendDataBoundItems set to true and EnableViewState Set to False.

When this is the case the selected item is always --Select-- which is the default item, even though the ComboBox is populated with items from SP List and selected item is different.

Issue 2:
In order to overcome this what i tried is to populate the ComBoBox when Add or Edit action for the Grid is triggered, but the error

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

is thrown.

The scenario here is that RADComboBox DataSourceID is not set, databinding is done during InitInsert or Edit action of the grid. I have SelectedValue set to '<%# Bind("Column Name") %>' this is for Edit action. Of Course if this is removed then the Insert action works, but i am using an EditForm template which is automatically used for Insert too. Which is how i want it to be.

Hope the issue is clear. I want either issue 1 or 2 to be resolved. Have attached pieces of codes where this issue is occurring.

Please advice.


0
Simon
Telerik team
answered on 22 Jun 2010, 03:26 PM
Hi Santosh Kannan,

We investigated the code you sent in the support ticket on the same matter and found that that the first issue is actually a bug.

We logged it in our bug-tracking system and will fix it in the upcoming weeks.

As a workaround you could bind the RadComboBox on each postback in the Init phase of the page:
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
 
    if (Page.IsPostBack)
        RadComboBox1.DataBind();
}

Kind regards,
Simon
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
0
Santosh Kannan
Top achievements
Rank 1
answered on 23 Jun 2010, 03:54 AM
Hi Simon,

Thanks for the work around, but the RADComboBox is in the edit Form template of RADGrid, how can i reference this page_Init event? I find some examples for referencing controls inside RADGrid but they are in a Grid event.

Pls advice.

Thanks.
0
Simon
Telerik team
answered on 23 Jun 2010, 02:56 PM
Hello Santosh Kannan,

You can use the Grid's Init event which fires (almost) at the same time and is also convenient for the data bind operation.

Kind regards,
Simon
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
0
Joel Reinford
Top achievements
Rank 1
answered on 27 Jul 2010, 03:10 PM
Has this bug been fixed in the Q2 release? I am experiencing a similar issue with Q2.
0
Simon
Telerik team
answered on 27 Jul 2010, 04:56 PM
Hi Joel Reinford,

The issue is not fixed yet.

Please vote for it here so that it moves up the priority list.

Best wishes,
Simon
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
ComboBox
Asked by
Santosh Kannan
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Santosh Kannan
Top achievements
Rank 1
Simon
Telerik team
Joel Reinford
Top achievements
Rank 1
Share this question
or