Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
Change button caption in CellButtonClick event?
posted

How to change value or button caption in "ClickCellButton"?

I am doing following and it doesn't work?

Private Sub ultraGridBasicCreationFilter_ClickCellButton(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles ultraGridBasicCreationFilter.ClickCellButton

If e.Cell.Value = "Accept Quote" Then

e.Cell.Value = "Unselect this item"

ElseIf e.Cell.Value = "Unselect this item" Then

e.Cell.Row.Cells("Action").Value = "Accept Quote"

End If

End Sub

 

Private Sub ultraGridBasicCreationFilter_InitializeRow(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles ultraGridBasicCreationFilter.InitializeRow

With e.Row.Cells("Action")

.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button

.Column.ButtonDisplayStyle = UltraWinGrid.ButtonDisplayStyle.Always

.Column.CellClickAction = CellClickAction.CellSelect

.Value = "Accept Quote"

End With

End Sub

 

Parents
  • 236
    posted

    More than likely you are calling databind on each postback.  If you are binding on each postback then the initializerow event is going to fire on each postback BEFORE your cell click event handler fires.

    So this will reset all values in the grid and only change the value of the cell they clicked on and erase any previous change.  If binding in the page load stick the databind call in an If Not IsPostback statement.

     

Reply Children