Question

I have a UltraGrid in which you can add a row by filling informations in the blank row on the top. I want to modify the row so that I don't see the button at the end like this (At the end of the grey line) :

enter image description here

I can't find where to modify this row only. Any Idea ?

Was it helpful?

Solution

There is an event called InitializeTemplateAddRow that is designed to customize the TemplateAddRow (this is the name of that row).
Despite the fact that a cell has a Hidden property I was not able to hide a particular cell of the TemplateAddRow without also hiding the whole column, but you could easily disable a particular cell with this code inside the event handler:

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top