Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight DataGrid Navigation and Hidden Rows
    primarykey
    data
    text
    <p>I have a scenario where I want to show hierarchical data in a DataGrid in Silverlight 3 while having the header rows still have the standard set of cells and being editable. The user needs to be able to collapse and expand rows to hide child rows.</p> <p>I've accomplished this by having a button on each parent row that looks like either a collapse or an expand glyph depending on its state. Clicking this manipulates a property on the data item for its child rows. Each row has its visibility bound to this property of the data item.</p> <p>This works somewhat decently, though it does have performance problems with the grid rendering more columns than it needs to.</p> <p>My problem now is that when the user hits up or down on the keyboard they are able to navigate to hidden rows.</p> <p>For example if I have a structure like</p> <p>1 Parent (Expanded, Visible)</p> <blockquote> <p>1a (Visible)</p> <p>1b (Visible)</p> </blockquote> <p>2 Parent (Collapsed, Visible)</p> <blockquote> <p>2a (Hidden)</p> </blockquote> <p>3 Parent (Expanded, Visible)</p> <blockquote> <p>3a (Visible)</p> </blockquote> <p>If I have [2 Parent] selected and I hit the down arrow on the keyboard I would expect the selection to go to [3 Parent] but it goes to [2a] instead even though [2a]'s row visibility is set to Visibility.Collapsed.</p> <p>I'd like to be able to either intercept the keyboard event (via something like the non-existent PreviewKeyDown event) and handle it myself or to find some way of tricking the DataGrid's internals of moving to the correct item.</p> <p>At this point I am fairly invested in tweaking the row visibility for hiding these items.</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload