Add data from one column of radGrid to RadCombobox

3 posts, 0 answers
  1. Andy
    Andy avatar
    107 posts
    Member since:
    Sep 2010

    Posted 30 Sep 2010 Link to this post

    Hi all!

    I would like to add all data from one column of RadGrid into the RadCombox.
    I'm just the new one of Telerik. Please help!

    Thanks!

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

    Posted 01 Oct 2010 Link to this post

    Hello Andy,


    You could set the same DataSource for RadComboBox which is used to populate the RadGrid and set the 'DataTextField' accordingly.

    Sample mark-up:
    <telerik:RadGrid ID="RadGrid1" ShowFooter="true" runat="server" DataSourceID="SqlDataSource1" GridLines="None">
         <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
             <Columns>               
                 <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID" SortExpression="CustomerID"
                     UniqueName="CustomerID">
                 </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName"
                     UniqueName="CompanyName">
                 </telerik:GridBoundColumn>
                  . . .
             </Columns>
         </MasterTableView>
     </telerik:RadGrid>
     
     
     <telerik:RadComboBox ID="NamesDDL" runat="server" AutoPostBack="false" DataSourceID="SqlDataSource1"
         DataTextField="CompanyName" DataValueField="CompanyName" Width="250px" Height="150px">   
     </telerik:RadComboBox>



    -Shinu.
  3. Andy
    Andy avatar
    107 posts
    Member since:
    Sep 2010

    Posted 01 Oct 2010 Link to this post

    Thanks Shinu!

    Actually, I have a RadRik with the "Car number" column and it has RadCombobox filter. I would like to copy all data from Car Number to this RadCombobox filter. I don't want to use the SQL because it can make the web slower

    Thanks!

    Andy.
Back to Top