Dear Telerik team,
we have a RadGridView descendant, that delivers some new properties as shown in code below.
The attached images are to demonstrate the unexplicable behaviour. To generate the hint shown in the statusbar on the bottom of these images we used the following code that already uses our own indexer property:
string
hint = HistoryGrid.MouseRow +
" / "
+": IsProcedure = "
+ ((
bool
)HistoryGrid[HistoryGrid.MouseRow,
"IsProcedure"
]);
(MousePointer not on image).
We use the hierarchy feature, so bold texts indicate that the entry is a procedure, containing child rows.
The status hint indicates that with its text.
While sorting is unchanged, ascending on column "Vom / Am", our indexer gets correct results (Images 1 and 2).
After sorting the same column descending (image 3), the indexer obviously addresses the wrong rows:
Row number is 4 (correct), but IsProcedure = true, incorrect, because row 4 in this sort order IS NOT a procedure.
Looks to us as if the Rows property of the RadGridView addresses the wrong rows after one did some sorting, is that possible?
Thanks to everybody with help on that.
Regards
Ron
Below the code we added to the RadGridView descendant:
internal
object
this
[
int
rowIndex,
string
columnName]
{
get
{
return
(rowIndex >= 0) ? Rows[rowIndex].Cells[columnName].Value :
null
; }
}
protected
override
void
OnMouseMove(MouseEventArgs e)
{
base
.OnMouseMove(e);
object
currentCell = ElementTree.GetElementAtPoint(e.Location);
if
(currentCell
is
GridDataCellElement)
{
var cell = currentCell
as
GridDataCellElement;
MouseRow = cell.RowIndex;
MouseColumn = cell.ColumnIndex;
}
else
if
(currentCell
is
GridGroupExpanderCellElement)
{
var cell = currentCell
as
GridGroupExpanderCellElement;
MouseRow = cell.RowIndex;
MouseColumn = -1;
}
else
if
(currentCell
is
GridExpanderItem)
{
MouseColumn = -1;
}
else
{
MouseRow = -1;
MouseColumn = -1;
}
}