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

Binding RadPanelBar generates "DataSource not set" since 2014.1.225

2 Answers 49 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Veronique
Top achievements
Rank 1
Veronique asked on 03 Apr 2014, 06:50 PM
I get a "DataSource not set" error when I bind a RadPanelBar.
To reproduce the bug, it must contain a RadPanelItem that contains a RadAutoCompleteBox.
The problem appeared in version 2014.1.225 and is still visible in the hotfix 2014.1.326

protected string RadPanelItemValue = "RadPanelItem1";
 
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        RadPanelBar1.DataBind(); // Generates an error: "DataSource not set"
    }
}


<telerik:RadPanelBar ID="RadPanelBar1" runat="server" >
    <Items>
        <telerik:RadPanelItem Value='<%# RadPanelItemValue %>' >
            <ItemTemplate>
                <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1"></telerik:RadAutoCompleteBox>
            </ItemTemplate>
        </telerik:RadPanelItem>
    </Items>
</telerik:RadPanelBar>

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Apr 2014, 04:40 AM
Hi Veronique,

By default the AutoComplete functionality is enabled for every character you enter, the data from the DataSource that matches with the search text will be displayed in a drop down. So if you have not set any DataSourceID in the RadAutoCompleteBox, the control will display a message as you described since it does not have any idea from where the matching entries should be populated in the drop down. To avoid this error you need to set the DataSource to the RadAutoCompleteBox as follows.

ASPX:
...
<
ItemTemplate>
    <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1" DataSourceID="SqlDataSource1" DataTextField="OrderID">
    </telerik:RadAutoCompleteBox>
</ItemTemplate>
...

Thanks,
Shinu.
0
Veronique
Top achievements
Rank 1
answered on 04 Apr 2014, 07:15 PM
Thanks. 
Setting the DataSource client side solves the issue.
Tags
PanelBar
Asked by
Veronique
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Veronique
Top achievements
Rank 1
Share this question
or