【问题标题】:UltraGrid modify new row columnsUltraGrid 修改新行列
【发布时间】:2013-04-01 20:10:30
【问题描述】:

我有一个UltraGrid,您可以通过在顶部的空白行中填写信息来添加一行。我想修改该行,这样我就不会像这样看到最后的按钮(在灰线的末尾):

我找不到只修改这一行的地方。有什么想法吗?

【问题讨论】:

  • 我不知道您是否可以将其视为答案,因此我将其发布为评论。你告诉我。有一个名为 InitializeTemplateAddRow 的事件,旨在自定义 TemplateAddRow(这是该行的名称)。尽管单元格具有 Hidden 属性,但我无法隐藏 TemplateAddRow 的特定单元格而不隐藏整个列,但您可以轻松禁用它设置 e.TemplateAddRow.Cells["Key"].Activation = Activation.Disabled;
  • @Steve 完美运行。你能把它作为答案让我接受吗?

标签: vb.net button infragistics ultrawingrid


【解决方案1】:

有一个名为InitializeTemplateAddRow 的事件旨在自定义TemplateAddRow(这是该行的名称)。
尽管单元格具有Hidden 属性,但我无法隐藏 TemplateAddRow 的特定单元格而不隐藏整个列,但您可以在事件处理程序中使用此代码轻松禁用特定单元格:

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

Private Sub UltraGrid1_InitializeTemplateAddRow(ByVal sender As Object, _
     ByVal e As Infragistics.Win.UltraWinGrid.InitializeTemplateAddRowEventArgs) _
     Handles UltraGrid1.InitializeTemplateAddRow
    ' Initialize the template add-row. You can set the default values for the cells
    ' in the add-row. When the user adds a new row through the template add-row, the
    ' new row will be initialized with these default values. 

    ' e.TemplateAddRow.Cells(0).Value = -1

    ' or totally disable the cells that that you don't want to use (e.g buttons like cells)

     e.TemplateAddRow.Cells["Key"].Activation = Activation.Disabled
End Sub

【讨论】:

    猜你喜欢
    • 2012-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多