This forum post is a duplicate of the support ticket you've submitted, I will summarize my response so that it is visible to the community. We can continue our conversation in the support ticket, as we have been doing, if you have any further questions.
Response:
The GridViewToggleRowDetailsColumn has no visibility into the DataContext of the row, thus it cannot determine if the row has RowDetails. You would need to build a custom column, that can perform some logic on the bound item, to determine if the RadToggleButton should be visible or not.
Attached is a demo and here's the relevant logic to hide the button:
public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
// 1 - create the UIElement that will be used for the "+" button
var toggleButton = new GridViewToggleButton { Margin = new Thickness(3) };
// 2 - Bind the DetailsRowVisibility property of the row to the IsChecked property of the ToggleButton
var row = cell.ParentRow as GridViewRow;
row?.SetBinding(GridViewRow.DetailsVisibilityProperty, new Binding("IsChecked") { Source = toggleButton, Converter = new BooleanToVisibilityConverter(), Mode = BindingMode.TwoWay });
// 3 - Get the data item
var book = dataItem as BookItemViewModel;
// 4 - KEY POINT- Hide ToggleButton if you don't want to show it
if (string.IsNullOrEmpty(book?.Summary))
toggleButton.Visibility = Visibility.Collapsed;
return toggleButton;
}
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.