When i Invoke the Event , it throws an error like Index (int)i either negative or above row count.
What can i do.. .
public void UserDeletingEvent (object sender, EventArg e)
{
BindingSource.RemoveAt(e.row.index);
}
When i Invoke the Event , it throws an error like Index (int)i either negative or above row count.
What can i do.. .
public void UserDeletingEvent (object sender, EventArg e)
{
BindingSource.RemoveAt(e.row.index);
}
Check that e.Row.Index
is greater than 0, there are reasons that it could be -1 which is an invalid index in the BindingSource
.
public void UserDeletingEvent(object sender, EventArg e)
{
if (e.Row.Index >= 0)
{
BindingSource.RemoveAt(e.Row.Index);
}
}
I found the index did not represent an actual row when the user clicked on the heading or the background area. You have to test that it is a valid index.
try pgitems.CurrentPageIndex = PageNumber;
setting that to nothing made it work for me, im building pagig for repeater, done the job