Error when using two related radcombox box in formview

2 posts, 0 answers
  1. Doan
    Doan avatar
    1 posts
    Member since:
    Apr 2014

    Posted 20 May 2014 Link to this post

    Hi All, I 'm a matter when using RadGrid and radwindow to
    insert/update data from database. I used Formview to add data( controls:
    textbox, combobox), but i used two related combox in formview to filter
    data , i have  error:
    Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
    My codes:
    1. combox 1:
    <telerik:RadComboBox ID="ddlMaSP" Runat="server" DataSourceID="SqlDsMaSP"

    DataTextField="TenSP" DataValueField="MaSP" SelectedValue='<%# Bind("MaSP") %>'

    Skin="Office2007" Width ="300px">


    <asp:SqlDataSource ID="SqlDsMaSP" runat="server"

    ConnectionString="<%$ ConnectionStrings:PGKH %>" SelectCommand="PGKH_CboMaSP"



    2. combbox thứ 2:

    <telerik:RadComboBox ID="ddlCTMaSP" Runat="server" DataSourceID="SqlDsCTMaSP"

    DataTextField="CTMaSP" DataValueField="IdCTMaSP"

    SelectedValue='<%# Bind("IdCTMaSP") %>' Skin="Office2007" Width ="300px">


    <asp:SqlDataSource ID="SqlDsCTMaSP" runat="server"

    ConnectionString="<%$ ConnectionStrings:PGKH %>"

    SelectCommand="PGKH_CboChiTietMaSP" SelectCommandType="StoredProcedure">


    <asp:ControlParameter ControlID="ddlMaSP" Name="MaSP"

    PropertyName="SelectedValue" Type="Int32" />


    I get error When i using Autopostback for two comboxbox, but i not
    use Autopostback is not error but two comboxbox not related. Thanks all.
  2. Nencho
    Nencho avatar
    1662 posts

    Posted 23 May 2014 Link to this post

    Hello Doan,

    Could you provide us with your entire implementation, in order to try to replicate the problem locally? In addition, please demonstrate the approach that you use to make the RadComboBoxes related.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top