Add button + text in Infragistics ultragrid column

Ratish picture Ratish · Jan 9, 2014 · Viewed 11.5k times · Source

I am using Infragistics 2013 version. I have a requirement wherein I have to add a button along with a text in a column in winforms ultragrid. The button will open a pop up screen which allows user to select a value that will be displayed as a text in the grid's column.

Thank you.

Answer

alhalama picture alhalama · Jan 13, 2014

Set the Style of the Column to ColumnStyle.EditButton. For example:

UltraGrid1.DisplayLayout.Bands(0).Columns("ColName").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton 

You can then handle the UltraGrids CellButtonClicked event to know when the button was clicked where e.Cell will let you know what cell was clicked:

Private Sub UltraGrid1_ClickCellButton(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles ultraGrid1.ClickCellButton
   Debug.WriteLine("Button in " & e.Cell.Value.ToString() & " cell was clicked.")
End Sub