I am using a grid, in which dynamically creating some columns and rows and EDIT buttons. While Updating the rows I am comparing DataRowVersion.Original and DataRowVersion.Current .
Its working fine when I did it first time, but when do it second time for another Edit and Update button. It shows the similar problem.
"There is no row at position 1"
Here is the code in Update button.
-
showMessage(){
-
var message = document.getElementById('<%=Message.ClientID %>');
-
if(message)
-
{
-
message.style.display='block';
-
}
-
}
-
for (int i = 0;i < dtDataChange.Columns.Count;++i)
-
{
-
if (Convert.ToString(dtDataChange.Rows[iIndex][i, DataRowVersion.Original]) != Convert.ToString(dtDataChange.Rows[iIndex][i, DataRowVersion.Current]))
-
{
-
String sCol = dtDataChange.Columns[i].ColumnName.ToString();
-
String sVal = dtDataChange.Rows[iIndex][i].ToString();
-
-
}
-
}
Thanks for helping hands in advance.
Alok