connection to combobox

2 posts, 0 answers
  1. Johnny
    Johnny avatar
    86 posts
    Member since:
    Dec 2010

    Posted 28 Sep 2011 Link to this post

    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>


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Sep 2011 Link to this post

    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.
Back to Top