I want to be able to validate all of the controls in all of the tabs in one button click event. I have all of the controls broken out into separate validation groups by their tab. The tricky part is that i want to know what tab has the invalid controls.
I tried creating an array of my validation groups in the same order as the tabs and then looping through it like so:
for (int i = 0; i < ValidationGroups.Count - 1; i++)
{
Page.Validate(ValidationGroups[i]);
if (!Page.IsValid)
RadTabStrip1.Tabs[i].ImageUrl = iconPath;
}
The problem is that Page.IsValid will always return false as soon as ANY validation group is false. So if I have invalid controls on the first tab, the Page.IsValid will always return false for every tab after that.
Does anyone have a better solution? Thanks!