How to change value or button caption in "ClickCellButton"?
I am doing following and it doesn't work?
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
.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button
.Column.ButtonDisplayStyle = UltraWinGrid.ButtonDisplayStyle.Always
.Column.CellClickAction = CellClickAction.CellSelect
.Value = "Accept Quote"
End With
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.
Sorry I should have mentioned I am using UltraWinGrid in client application. Its not web based application. Thanks for your reply
The InitializeRow is going to fire again when yuo set the Value of a cell. So it's just going to set the value back to the original value. You need to check the e.ReInitialize flag in InitializeRow so that you only set the value the first time the row is initialized.
moved to wingrid forum