Adnan
asked on
Getting row not in table exception: This row has been removed from a table and does not have any data.BeginEdit() will allow creation of new data in this row
Hi
I have never seen this exception before and iam stucked with how to resolve this...?
Can anyone guide how i can fix this?
I have never seen this exception before and iam stucked with how to resolve this...?
Can anyone guide how i can fix this?
public decimal Sum
{
get
{
decimal mySum = 0;
foreach( DsReconItems.MatchItemRow row in reconcileRows )
{
mySum += row.Amount; GETTING EXCEPTION HERE
}
return mySum;
}
}
Which UI are you working with (Winforms, WPF?)
I know for sure on WPF that when you switch tabs, the UI of the old tab get unloaded and when you return back to it, it reloads.
I can't understand the whole logic of your code without seeing it, but it must be something with the Load event.
(I can assume that you load your DsReconItems.MatchItemRow on your Load event of the UserControl/UI which is located inside the tab, am I right?)
I know for sure on WPF that when you switch tabs, the UI of the old tab get unloaded and when you return back to it, it reloads.
I can't understand the whole logic of your code without seeing it, but it must be something with the Load event.
(I can assume that you load your DsReconItems.MatchItemRow on your Load event of the UserControl/UI which is located inside the tab, am I right?)
ASKER
hi
yes man,i load my DsReconItems.MatchItemRow on Load event of the UserControl, wich is located inside the tab...????!
and iam working with WinForms, WPF!
yes man,i load my DsReconItems.MatchItemRow on Load event of the UserControl, wich is located inside the tab...????!
and iam working with WinForms, WPF!
ASKER
here is my code where i call tab_click event....
and at this line i call to function decimal Sum function where i get error...code above...
and at this line i call to function decimal Sum function where i get error...code above...
private void tabSrch_Click(object sender, EventArgs e)
{
if (showReconciled)
{
ReconManuallyGridView.Visible = true;
btnReconcile.Text = GetValue("reconcile");
ClearLeftRightPage();
SetSelectedTab(tabButtonOpenItems);
ShowReconciled();
}
if (manRecon.Diff != 0)
{
searchControl1.ClearControls();
searchControl1.searchTextDecimalFieldAmount.TextBox.Text = manRecon.Sum.ToString(); I CALL TO DECIMAL Sum FUNCTIUN here....
}
SetSelectedTab(tabSrch);
//ReconManuallyGridView.SendToBack();
searchControl1.SearchDb();
}
ASKER
if i change my code lines to:
searchControl1.searchTextD ecimalFiel dAmount.Te xtBox.Text = manRecon.Sum.ToString();
searchControl1.ClearContro ls();
The i stop getting this exception...but i want my data grid/dataset whatever to remeber those rows i had searched for before i swicthed to another tab and back again??!!! the state of the row is detached...?!
searchControl1.searchTextD
searchControl1.ClearContro
The i stop getting this exception...but i want my data grid/dataset whatever to remeber those rows i had searched for before i swicthed to another tab and back again??!!! the state of the row is detached...?!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
oki the issue here was that i was clearing my dataset before so i get this message...i have resolved it by clearing ds after....
ASKER