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

submitting textbox data from panelbar to sql database

1 Answer 89 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ufuoma
Top achievements
Rank 1
Ufuoma asked on 21 Jan 2013, 10:12 AM
Hello,

Please, I am trying to submit data from controls like the textbox to the database from the panelbar containing them.

The problem is I cannot access the textbox properties in my code behind. Like I am not doing something right.

Thanks for the anticipated help.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Jan 2013, 11:38 AM
Hi,

I suppose you want to access the controls inside the RadPanelBar. Here is the sample code.

ASPX:
<telerik:RadPanelBar ID="RadPanelBar1" runat="server">
    <Items>
        <telerik:RadPanelItem Text="RadPanelItem1">
            <ItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server" Text="text"></asp:TextBox>
            </ItemTemplate>
        </telerik:RadPanelItem>
    </Items>
</telerik:RadPanelBar>

C#:
//accessing the controls
TextBox txt = (TextBox)RadPanelBar1.FindItemByText("RadPanelItem1").FindControl("TextBox1");

Hope this helps.

Regards,
Princy.
Tags
PanelBar
Asked by
Ufuoma
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or