Hello,
I got the XPanderControl written in C# except for the IComparer implementation ini XPanderComparer. I'm getting an invalid cast exception with C# code like:
public
int Compare(object x, object y)
{
XpanderControl xpander1 = (XpanderControl)x;
XpanderControl xpander2 = (XpanderControl)y;
int result = 0;
if( xpander1.Top < xpander2.Top )
result = -1;
if( xpander1.Top > xpander2.Top )
result = 1;
return result;
}
This mirrors the VB.NET implementation as close as I can get it. When debugging, I can't get the VB.NET code to break at the Compare method. In C#, the Compare method seems to fire when a new XPanderControl is added to the XPanderList's Sorted list (Add method).
In short, I can addone XPanderControl to the XPanderList (in C#) with no problems. When I try and add a second XPanderControl, the XPanderComparer type gets involved and throws an invallid cast exception (C# only, not VB.NET).
Totally clueless 'bout whats going on. Any insight appreciated.
Bob