Un-expanding rowdetails

Oct 8, 2009 at 10:17 PM
What would be the easiest way to un-expand selected RowDetails WITHOUT
selecting another row? What event would handle this in the cleanest way?

Thanks,

Bill
Oct 9, 2009 at 3:22 AM

Depends on how you want to interact with it.  Set it's visibilty to collapsed on any event you want.

myDataGrid.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Collapsed

Oct 9, 2009 at 8:44 PM
Well, I learned some new things and here's what I did:

private void JobListGrid_MouseDown(object sender, MouseButtonEventArgs e) {
ToggleJobDetailsVisibility(this.selectedOrder);
}

private void ToggleJobDetailsVisibility(object obj) {
try {
Visibility visibility = JobListGrid.GetDetailsVisibilityForItem(obj);
if (visibility == Visibility.Visible) {
JobListGrid.SetDetailsVisibilityForItem(obj, Visibility.Collapsed);
JobListGrid.ClearDetailsVisibilityForItem(obj);
} else {
JobListGrid.SetDetailsVisibilityForItem(obj, Visibility.Visible);
JobListGrid.ClearDetailsVisibilityForItem(obj);
}
} catch (Exception ex) {
log.Error("ToggleJobDetailsVisibility", ex);
System.Diagnostics.Debug.WriteLine(ex.Message);
System.Diagnostics.Debug.WriteLine(ex.StackTrace);
}
}

Happy coding,

Bill


On 10/8/2009 10:22 PM, jefestx wrote:
>
>
> From: jefestx
>
> Depends on how you want to interact with it. Set it's visibilty to
> collapsed on any event you want.
>
> myDataGrid.RowDetailsVisibilityMode =
> DataGridRowDetailsVisibilityMode.Collapsed
>
> Read the full discussion online
> <http://wpf.codeplex.com/Thread/View.aspx?ThreadId=71429&ANCHOR#Post243696>.
>
> To add a post to this discussion, reply to this email
> ([email removed]
> <mailto:[email removed]?subject=[wpf:71429]>)
>
> To start a new discussion for this project, email
> [email removed] <mailto:[email removed]>
>
> You are receiving this email because you subscribed to this discussion
> on CodePlex. You can unsubscribe or change your settings
> <https://wpf.codeplex.com/subscriptions/thread/project/edit> on
> codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any
> posts to this discussion will also be available online at codeplex.com
>