我有一个UltraGrid
,您可以通过填充顶部空白行中的信息来添加行。我想修改这行,这样我就不会在这样的结尾看到按钮(在灰线的末尾):
我找不到仅修改此行的位置。有什么想法吗?
答案 0 :(得分:2)
有一个名为InitializeTemplateAddRow
的事件旨在自定义TemplateAddRow
(这是该行的名称)。
尽管单元格具有Hidden
属性,但我无法隐藏TemplateAddRow的特定单元格而不隐藏整个列,但您可以使用此代码在事件处理程序中轻松禁用特定单元格:< / p>
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