Hello-
I have a hierarchical grid (Customers->Orders). Currently, the only way to expand customers to view orders is to click on the + icon. I'd like to have it so if you click on any field in the Customer Row (i'm refering to this as the header), the row will expand to show orders. Conversly, if you click on a customer row and it's already expanded I'd like it to collapse.
I tried handling the MouseDown event of the active record, but that code never gets executed for some reason. Is there a better way to acheive this? I have code handling the RecordActivated event which works fine for the expand, but does not handle the collapse (because the row is already activated)
Thanks in advance!
I just realized that my terminiology might be confusing. I simply meant clicking on a row to expand its child rows.
I would like to know the answer to this also ..
My next DataGrid Im working on is going to be a grid like what your working on.
ps: I'd like a way to collapse a record by single-clicking on it. The little "+" symbols are SOOOO small and for many situations, it makes a lot of sense to allow single-clicks to expand/collapse a group. So far, I haven't found a way to do this, since the RecordActivated is not sent once the record is clicked on and expanded the first time.
I'd like to see a property on the control to enable this behavior, which would elimnate the need for sinking the event and provide a means for collapsing.
In general, I think there is room for additional properties throughout the control that would make things easier and eliminate coding in events.
If you sit on the RecordActivated Event and then set the IsExpanded property of the record to true, you'll get what you're looking for.
RecordActivated="XamDataGridXXXX_RecordActivated"
...
{
}