Hi,
I am having two issues with a RadGridView and need some help.
In the attached movie, there is a gridView with two "optional" columns : one with check boxes and one with buttons.
This is to allow a user to modify values in the associated DB Table either individually with the buttons or as a group via the check boxes.
However, I want only one column active at any time. The selection being done via the upper left label.
Note that I do not want the CommandColumn to be hiden, as the buttons labels also convey status information.
The problems are as follow :
1- when the form is loaded, I only want to show the lines where buttons in the "ready for update" state (written "Mettre à jour"). So I hide the other rows labelled "Not Ready". Doing this in the CellFormatting event works, but due to the virtualisation, as you can see in the attached movie, if the user move the colums too fast, the Not ready cells are temporarily displayed ( I tried a MasterTemplate.Refresh but this crash the form load with an index invalid exception in Telerik code).
How can I solved this ?
2 - when I click on the label (used as a button) to show the Check box column, it should change color in grey. As you can see, it does it (on the whole column as expected) but only if I click on any of the column button.
Here is the CellFormatting code :
private void gvMajBoutique_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is not GridCommandCellElement commandCell) return; var row = commandCell.RowInfo; if (row == null) return; string ugs = row.Cells["Sku"].Value.ToString(); if (ugs != null && SuiviDesModifications.ContainsKey(ugs)) { StatusModifsPrixBoutique state = SuiviDesModifications[ugs]; if (state == null) return; if (state.CurrentState == ChangeButtonState.UpdateReady) { commandCell.CommandButton.Text = state.CurrentButtonName; row.IsVisible = true; } else if (state.CurrentState == ChangeButtonState.UpdateForbidden) { row.IsVisible = false; } if (StatusColumnEnabled) { commandCell.CommandButton.ButtonFillElement.BackColor = Color.PapayaWhip; commandCell.CommandButton.ButtonFillElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; commandCell.CommandButton.Enabled = true; } else { commandCell.CommandButton.ButtonFillElement.BackColor = Color.LightGray; commandCell.CommandButton.ButtonFillElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid; commandCell.CommandButton.Enabled = false; } // This crash the form //gvMajBoutique.MasterTemplate.Refresh(); } }
Thanks for your answers
Patrick