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

[Solved] DetailsView - RadComboBox (Bind)

3 Answers 237 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jean-Yves
Top achievements
Rank 1
Jean-Yves asked on 18 Apr 2009, 02:52 PM
Hi, 

I'm using a asp:DetailsView with different fields, and one of them is : 

<asp:TemplateField HeaderText="Type d'affaire"
    <ItemTemplate> 
        <%#Eval("TypeAffaire.Libelle")%> 
    </ItemTemplate> 
    <EditItemTemplate> 
        <telerik:RadComboBox ID="RadComboBoxTypeAffaire" runat="server" Skin="Hay"  
            DataSourceID="LinqDataSourceTypeAffaire" DataTextField="Libelle" 
            DataValueField="IdTypeAffaire" SelectedValue='<%# Bind("TypeAffaire.IdTypeAffaire") %>'
        </telerik:RadComboBox> 
        <asp:LinqDataSource ID="LinqDataSourceTypeAffaire" runat="server"  
            ContextTypeName="isiweb.Common.DAO.LinqToSqlDataContext"  
            TableName="TypeAffaires"
        </asp:LinqDataSource> 
    </EditItemTemplate> 
</asp:TemplateField> 

When I switch to edit mode, the comboBox take the right value with the SelectedValue='<%# Bind("TypeAffaire.IdTypeAffaire") %>'> After, I change de value... And I click on Update. I go on OnItemUpdated to see what happen and I see that 1 row is affected... It's great...

But, when I'm back to the 'normal' mode, the value of the combobox go back to the old value. :o

Do you fine a problem with my code ? 
Thank you, 

Jean-Yves

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 20 Apr 2009, 12:38 PM
Hello Jean-Yves,

This is very strange indeed. Does the problem exist if you use the built-in DropDownList control instead of RadComboBox? Could you verify that your datasource is correctly updated upon saving?

Regards,
Albert
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
Jean-Yves
Top achievements
Rank 1
answered on 06 May 2009, 03:15 PM
Sorry,

I wasn't here for few days.
I'am back on my problem.

So, I try to put a DropDownList, and I have the same problem.
What is crazy is that in the ItemUpdating event, I can seen that there is new values.

I don't know at all what it could be.

You don't have a detail view telerik ? (RadDetailView?)

Thank you

Jean-Yves
0
Veselin Vasilev
Telerik team
answered on 11 May 2009, 01:22 PM
Hello Jean-Yves,

Have you set the EnableUpdate property to True of the DetailsView's LinqDataSource?

I have prepared a small project for you - please download it and give it a try.

I hope this helps.

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.
Tags
ComboBox
Asked by
Jean-Yves
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jean-Yves
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or