This question is locked. New answers and comments are not allowed.
Hello,
I have a RadGridView and I don’t want to enable the Expand button (+) to expend (to be open) if the "IsDivided" property value =false.
I added a RowLoaded Event " RefundsGrid_RowLoaded" where I set the IsExpandable property of the row to false but it's not disabling the "+" to be expend (open) .
I read this blog: http://blogs.telerik.com/xamlteam/posts/10-06-03/how---to-bind-to-isexpandable-property-of-gridviewrow-in-radgridview-for-wpf-with-attached-behaviors.aspx
But I'm not sure if it's relevant in my case.
On I put on "IsVisible" value false it work OK and don't show the (+). But when I Binding in to property IsDivided. it's not working
and the second option I try is this.
The code is as follows:
What am I missing?
I have a RadGridView and I don’t want to enable the Expand button (+) to expend (to be open) if the "IsDivided" property value =false.
I added a RowLoaded Event " RefundsGrid_RowLoaded" where I set the IsExpandable property of the row to false but it's not disabling the "+" to be expend (open) .
I read this blog: http://blogs.telerik.com/xamlteam/posts/10-06-03/how---to-bind-to-isexpandable-property-of-gridviewrow-in-radgridview-for-wpf-with-attached-behaviors.aspx
But I'm not sure if it's relevant in my case.
On I put on "IsVisible" value false it work OK and don't show the (+). But when I Binding in to property IsDivided. it's not working
<
telerik:GridViewToggleRowDetailsColumn
Width
=
"10"
IsResizable
=
"False"
IsVisible
=
"{Binding IsDivided}"
/>
public
bool
IsDivided
{
get
{
return
(DivideCode.Equals(
'k'
));
}
}
and the second option I try is this.
The code is as follows:
What am I missing?
<
UserControl.Resources
>
<
DataTemplate
x:Key
=
"RefundProvisionsGridCell"
>
<
uc:RefundProvisionsGrid
/>
</
DataTemplate
>
</
UserControl.Resources
>
<
telerik:RadGridView
Name
=
"RefundsGrid"
RowLoaded
=
"RefundsGrid_RowLoaded"
ItemsSource
=
"{Binding Refunds}"
RowDetailsTemplate
=
"{StaticResource RefundProvisionsGridCell}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewToggleRowDetailsColumn
Width
=
"10"
IsResizable
=
"False"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
private
void
RefundsGrid_RowLoaded(
object
sender, RowLoadedEventArgs e)
{
if
(e.DataElement !=
null
)
{
GridViewRow row = e.Row
as
GridViewRow;
Refund refund = (Refund)e.DataElement;
if
(row !=
null
&& refund !=
null
)
{
row.IsExpandable = refund.IsDivided;
//try this one with no help
row.IsExpanded = refund.IsDivided;
//try this one with no help
row.DetailsVisibility = refund.IsDivided ? Visibility.Visible : Visibility.Collapsed;
//try this one with no help
}
}
}