【问题标题】:GridRatingColumn show nothing with null valuesGridRatingColumn 不显示空值
【发布时间】:2013-06-26 15:16:00
【问题描述】:

我正在开发一个 RadGrid,它的所有列和数据绑定都在运行时完成。网格中的一列是 GridRatingColumn。它有效,但我希望能够区分值为 0 的项目和没有值的项目(空)。目前,GridRatingColumn 显示 Null 值的评分为 0。

有没有办法让 GridRatingColumn 为空(无星号)且值为 Null 并显示值为 0 的空白星号?

代码:

Dim colScore As GridRatingColumn = New GridRatingColumn
_grid.MasterTableView.Columns.Add(colScore)
colScore.DataField = "score"
colScore.HeaderText = "Score"
colScore.UniqueName = "colScore"
colScore.ItemCount = 5
colScore.Precision = RatingPrecision.Half

【问题讨论】:

    标签: vb.net telerik radgrid


    【解决方案1】:

    您可以尝试在网格的 RowDataBound 事件中隐藏与空评级对应的控件。

    根据 Telerik 文档(更多详细信息可以在这里找到here),您可以像这样手动检索控件:

    每个列单元格中的评分控件的 ID 是 Rating_[ColumnUniqueName],其中 [ColumnUniqueName] 是 UniqueName GridRatingColumn 实例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-13
      • 2021-12-18
      • 1970-01-01
      • 2020-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-10
      相关资源
      最近更新 更多