General information
Category:
The Mere Mortals .NET Framework
hmm, using the post delete hook does not seem tio be the right way, so I think the solution should be changing the ClearAllRules code to the following (similar changes shuold be made to ClearAllWarnings):
public override void ClearAllRules()
{
mmErrorProviderArgs ep;
this.BrokenRules.Clear();
// Clear all error provider broken rules
for (int i = 0; i < ErrorProviderBrokenRules.Count; i++)
{
ep = (mmErrorProviderArgs)ErrorProviderBrokenRules[i];
if (ep.DataView != null)
{
// Bug fix begin:
if (ep.Row < ep.DataView.Count)
{
ep.DataView[ep.Row].Row.SetColumnError(ep.ColumnName, "");
}
//ep.DataView[ep.Row].Row.SetColumnError(ep.ColumnName, "");
// bug fix end
}
else
{
if (ep.ErrorDataSet != null)
{
// Bug fix begin:
if (ep.Row < ep.ErrorDataSet.Tables[ep.TableName].Rows.Count)
{
ep.ErrorDataSet.Tables[ep.TableName].Rows[ep.Row].SetColumnError(ep.ColumnName, "");
}
//ep.ErrorDataSet.Tables[ep.TableName].Rows[ep.Row].SetColumnError(ep.ColumnName, "");
// bug fix end
}
}
}
this.ErrorProviderBrokenRules.Clear();
}
regards
Stig Nielsson
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only