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

Add data from one column of radGrid to RadCombobox

2 Answers 97 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 30 Sep 2010, 11:32 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Oct 2010, 06:00 AM
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.
0
Andy
Top achievements
Rank 1
answered on 01 Oct 2010, 03:15 PM
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.
Tags
ComboBox
Asked by
Andy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Andy
Top achievements
Rank 1
Share this question
or