【问题标题】:Can't Add ComboBox to Radgrid无法将 ComboBox 添加到 Radgrid
【发布时间】:2019-04-09 09:37:36
【问题描述】:

[查看][1]我正在创建一个有界 radgrid,我试图将有界组合框添加到 rad 网格,但列正在显示。组合框不显示。

【问题讨论】:

  • 请将代码和数据添加为文本 (using code formatting),而不是图像。图片:A)不允许我们复制粘贴代码/错误/数据进行测试; B) 不允许根据代码/错误/数据内容进行搜索;和many more reasons。除了代码格式的文本之外,只有在图像添加了一些重要的东西,而不仅仅是文本代码/错误/数据传达的内容时,才应该使用图像。

标签: 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);
    

    【讨论】:

      猜你喜欢
      • 2014-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多