I'm having an issue with RadGridView1_RowsChanged event. Normally this event will trigger if I modify the row content and moved to another row. If the row contains a cell with NULL values and I clicked on that cell and without editing I moved to another row, then also the RadGridView1_RowsChanged event triggered which is causing me issue. What I'm trying to do in my project is that I need to get the edited row details and update that to database on a button click. If I go through a null cell and moved to another row then also RadGridView1_RowsChanged event triggerd and my edited row index valu will change and I'm not able to save the details to database. Some part of my code is given below. Can anybody help me?
private void radGridHome_RowsChanged(object sender, GridViewCollectionChangedEventArgs e) |
{ |
try |
{ |
if (isGridLoadCompleted) |
{ |
isRowsChanged = true; |
//Getting the edited rows index |
previousRowIndex = e.NewStartingIndex; |
if (!arrRowChangedIndex.Contains(e.NewStartingIndex)) |
{ |
arrRowChangedIndex.Add(e.NewStartingIndex); |
} |
Console.WriteLine("RowsChanged @ " + e.NewStartingIndex + e.OldStartingIndex + " "); |
} |
} |
catch (Exception ex) |
{ |
WriteLogFile(ex.ToString(), "radGridHome_RowsChanged"); |
} |
} |
private void radGridHome_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e) |
{ |
try |
{ |
if (isGridLoadCompleted && isRowsChanged && chkSaveExitingRow.Checked) |
{ |
// Updating the edited row details to datatbase |
UpdateCustomerOrderInfo(chkSaveExitingRow.Checked, false, previousRowIndex); |
isRowsChanged = false; |
} |
arrPastRowValue.RemoveRange(0, arrPastRowValue.Count); |
} |
catch (Exception ex) |
{ |
WriteLogFile(ex.ToString(), "radGridHome_CurrentRowChanged"); |
} |
} |