BUG? VS2007 DataGrid.IsSelected( ) method doesn't work (MSDN Universal Subscriber)



1st I know about the new DataGridView control. For various reasons we need
the IsSelected( ) method of the old DataGrid to work in the upgraded apps.

I have a small test app that illustrates the problem.

The following code works great in C# Net 1.0 & Net 1.1 apps ... doesn't work
for Net 2.0 apps.

Cannot get pDg.IsSelected(i) to toggle to 'true' for 'highlighted' rows in a
DataGrid control.


private int CountSelectedDataGridRows(DataGrid pDg)
{
int i = 0;
int iSelectedRowCount = 0;

CurrencyManager cm =
(CurrencyManager)this.BindingContext[pDg.DataSource, pDg.DataMember];
DataView dv = (DataView)cm.List;

for (i = 0; i < dv.Count; ++i)
{
if ( pDg.IsSelected(i) )
{
++iSelectedRowCount;
}
}

return iSelectedRowCount;
}

Any help would be greatly appreciated. We are MSDN Universal subscribers.
Does MS still monitor this group?

Thanks in advance.

Barry
in Oregon


.



Relevant Pages