【问题标题】:Can't Add ComboBox to Radgrid无法将 ComboBox 添加到 Radgrid
【发布时间】:2019-04-09 09:37:36
【问题描述】:
[查看][1]我正在创建一个有界 radgrid,我试图将有界组合框添加到 rad 网格,但列正在显示。组合框不显示。
【问题讨论】:
标签:
c#
asp.net
sql-server-2012
telerik
radgrid
【解决方案1】:
您可以找到各种将 RadGrid 与 this post 中提供的组合/下拉列表结合使用的示例。
【解决方案2】:
首先:您需要更明确地表达您的问题或问题。
或许添加一点代码或图片会帮助我们了解更多。
据我了解,您有一个 radgridview,并且您希望特定列具有一个组合框作为类型。
你可以这样做:
//define a GridViewMultiComboBoxColumn
GridViewMultiComboBoxColumn column = new GridViewMultiComboBoxColumn();
column.Name = "Your column name";
column.HeaderText = "The header text you want to have";
column.FieldName = "Field name, maybe you have a class read from a db";
column.DataSource = ds; //here you need to define your datasource for your combobox
column.ValueMember = "Value"; //depends on what you receive from datasource
column.DisplayMember = "Value"; //depends on what you receive from datasource
//add the column to your radgridview
gridView.MasterTemplate.Columns.Add(column);