I am using a GridViewCheckBoxColumn. My requirement is i will hide the checkbox in each row if binded value lavel is 6. I had used one Cell Style Selector. If i make the visibility=Collapsed then the cell as well as cell border is also not displayed and looking odd. Please help me how i will be able to collapse few cells based on above condition with the only checkbox collapsed and border remain as it is
return CollapsedStyle;
public
class CustomVisibilityStyle : StyleSelector
{
public override Style SelectStyle(object item, DependencyObject container)
{
PeopleDataDC ppl = item as PeopleDataDC;
if (ppl.Level == 6)
{
return VisibleStyle;
}
else
{
//((System.Windows.Controls.
ContentPresenter)(((System.Windows.Controls.Grid)(((Telerik.Windows.Controls.GridView.GridViewCell)(container)).Template.LoadContent())).Children[7])).Visibility = Visibility.Collapsed;
return CollapsedStyle;
}
return CollapsedStyle;
}
public Style VisibleStyle { get; set; }
public Style CollapsedStyle { get; set; }
}