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

connection to combobox

1 Answer 112 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Johnny
Top achievements
Rank 2
Johnny asked on 28 Sep 2011, 08:00 AM
hello,
i'm creating a few radcombobox inside the radpanelbar. i already make connection to database for 1st combobox. how can i do the other connection to other combobox?

this is the 1st combobox for user
<td>

 <telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true" runat="server" Width="289px"

 Height="200px" DataSourceID="SqlDataSource1" DataTextField="UserName"

 EmptyMessage="Search for people...">

 </telerik:RadComboBox>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FingertipsConnectionString %>"

SelectCommand="SELECT [UserName] FROM [AuditTrail] Order By UserName"></asp:SqlDataSource>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="RadComboBox2">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="RadComboBox1" />

 </UpdatedControls>

 </telerik:AjaxSetting>

 </AjaxSettings>

 </telerik:RadAjaxManager>
</td> </tr>

 

 

this is the 2nd combobox for database. this combobox i want to connect to database to get the content from column "database"
<td>

<asp:Label runat="server" ID="databaseLabel" AssociatedControlID="RadComboBox3">Database:</asp:Label>

 </td>

<td>

<telerik:RadComboBox ID="RadComboBox3" AllowCustomText="true" runat="server" Width="289px"

 Height="200px" DataSourceID="SqlDataSource2"

 EmptyMessage="Search for database...">

 </telerik:RadComboBox>

  <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:FingertipsConnectionString %>"

 SelectCommand="SELECT [Database] FROM [AuditTrail]"></asp:SqlDataSource>

 </td>


1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Sep 2011, 08:30 AM
Hello Johnny,

You can set the DataText fielld property to the required filed (here Database) to show the text in RadComboBox.
Also take a look into the following help article for more on this.
Data Binding Overview.

Thanks,
Shinu.
Tags
ComboBox
Asked by
Johnny
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or