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

How to add GridBoundColumn and dropdown to radgrid?

2 Answers 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sho
Top achievements
Rank 1
sho asked on 27 Jul 2011, 11:32 AM
Hi,

  I want to populate my radgrid with the data using GridBoundColumn and dropdown controls.

I am able to place the GridBoundColumn like

<Columns>
      <telerik:GridBoundColumn ReadOnly="true" SortExpression="Name" HeaderText="Employee Name"
      DataField="EmployeeName" ItemStyle-Width="150px"><ItemStyle Width="150px"></ItemStyle>
      </telerik:GridBoundColumn>
</Column

I want to add a dropdown box next to the above field to populate data. How can I do this?

Regards,
Aradhya

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 27 Jul 2011, 12:28 PM
Hello Aradhya,

You can add a DropDownlist in ItemTemplate or you can add a GridDropDownColumn as shown below.
aspx:
<Columns>
  <telerik:GridTemplateColumn>
     <ItemTemplate>
         <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="OrderID" DataValueField="Freight">
         </asp:DropDownList>
     </ItemTemplate>
  </telerik:GridTemplateColumn>
       <%--   Another method using GridDropDownColumn--%>
    <telerik:GridDropDownColumn DataField="OrderID" HeaderText="drop" UniqueName="GridDropDownColumn"
    ListTextField="OrderID" DropDownControlType="DropDownList" ListValueField="Freight"
    DataSourceID="SqlDataSource1">
    </telerik:GridDropDownColumn>
</Columns>

Thanks,
Princy.
0
abinav
Top achievements
Rank 1
answered on 27 Jul 2011, 12:38 PM
try using template field or dropdown column to populate data we cannot customize boundcolumn to have controls inside it
Tags
General Discussions
Asked by
sho
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
abinav
Top achievements
Rank 1
Share this question
or