A
aaa
Hi
I am trying to create a read-only DataGrid that would always have
current row selected. Currently, I am using method:
public void SelectDataGridRow(DataGrid dg)
{
if (dg.CurrentRowIndex > -1)
{
dg.Select(dg.CurrentRowIndex);
}
}
to select current row. I call this method from Click, DoubleClick and
CurrentCellChanged event handlers and it works fine. The thing is that I
can not select aproporiate row when column header is clicked (and
DataGrid sorted).
I tried to use CurrencyManager associated with my grid's DataSource
(PositionChanged and CurrentChanged events), but the code above doesn't
work from these event handlers (The handler method is called when
needed, but approporiate row is not selected).
thnx in advance
I am trying to create a read-only DataGrid that would always have
current row selected. Currently, I am using method:
public void SelectDataGridRow(DataGrid dg)
{
if (dg.CurrentRowIndex > -1)
{
dg.Select(dg.CurrentRowIndex);
}
}
to select current row. I call this method from Click, DoubleClick and
CurrentCellChanged event handlers and it works fine. The thing is that I
can not select aproporiate row when column header is clicked (and
DataGrid sorted).
I tried to use CurrencyManager associated with my grid's DataSource
(PositionChanged and CurrentChanged events), but the code above doesn't
work from these event handlers (The handler method is called when
needed, but approporiate row is not selected).
thnx in advance