Forum
See question

Como verificar se uma celula numa PriGrelha foi alterada   

3 views
0
0

Boa tarde,

Fiz o código abaixo para identificar se uma celula numa PriGrelha foi alterada. O código funciona bem no entanto se eu fizer copy paste o código não identifica que a celula foi alterada (isto porque não é activado o ImportaCBLGrelha_BeforeEditMode.

private void ImportaCBLGrelha_LeaveCell(object Sender, PriGrelha.LeaveCellEventArgs e)
{
var coluna = ImportaCBLGrelha.Cols.GetEdita(e.Col).ColKey.ToString();

// Retrieve the original value from the dictionary
object originalValue = originalCellValues.TryGetValue((e.Row , e.Col ), out var value) ? value : null;

if (originalValue !=null)
{
object currentValue = ImportaCBLGrelha.GetGRID_GetValorCelula(e.Row, coluna);

if (!Equals(originalValue, currentValue))
{
status.Text = “POR VALIDAR”;
status.BackColor = System.Drawing.Color.Red;
}

// Remove the original value from the dictionary
originalCellValues.Remove((e.Row, e.Col));

}
}

private void ImportaCBLGrelha_BeforeEditMode(object Sender, PriGrelha.BeforeEditModeEventArgs e)
{
var coluna = ImportaCBLGrelha.Cols.GetEdita(e.Col).ColKey.ToString();
originalCellValues[(e.Row, e.Col)] = ImportaCBLGrelha.GetGRID_GetValorCelula(e.Row, coluna);
}

Faça login para poder traduzir
V10
Marked as spam
Created 1 week and 5 days ago nunodomingues
nunodomingues Iniciante