[Note to Telerik: I messed the title up! Could you change it to "Enable/Disable editing of cell for individual rows"]
I have a GridView where some of the columns are editable and some are readonly. But now I also have some columns that should be editable for some rows but not for others.
The GridView is bound to a list of items. These items are of a custom type/class that has properties for each column of the GridView. The class also has a property which tells if those columns (that are sometimes editable) should be editable or not.
How can I make this work?
I specify the columns of the grid manually with XAML. The columns have a CellTemplate (usually with a TextBlock), and those that can be edited also has a CellEditTemplate (usually with a TextBox). The switching between those works fine, but sometimes I don't want that switch to happen. That is, even if the user clicks the cell to edit it, the cell shouldn't switch over to edit mode (using CellEditTemplate) if that cell is not editable for that particular row.
Some code to illustrate my situation
So.. can I by using the "ThisRowIsFullyEditable" property make the column Age editable or not for each row individually?
Thanks // David
I have a GridView where some of the columns are editable and some are readonly. But now I also have some columns that should be editable for some rows but not for others.
The GridView is bound to a list of items. These items are of a custom type/class that has properties for each column of the GridView. The class also has a property which tells if those columns (that are sometimes editable) should be editable or not.
How can I make this work?
I specify the columns of the grid manually with XAML. The columns have a CellTemplate (usually with a TextBlock), and those that can be edited also has a CellEditTemplate (usually with a TextBox). The switching between those works fine, but sometimes I don't want that switch to happen. That is, even if the user clicks the cell to edit it, the cell shouldn't switch over to edit mode (using CellEditTemplate) if that cell is not editable for that particular row.
Some code to illustrate my situation
<
telerikGridView:GridViewDataColumn
Header
=
"Age"
DataMemberBinding
=
"{Binding Path=Age}"
>
<
telerikGridView:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Path=Age, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
/>
</
DataTemplate
>
</
telerikGridView:GridViewDataColumn.CellTemplate
>
<
telerikGridView:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
TextBox
Text
=
"{Binding Path=Age, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
/>
</
DataTemplate
>
</
telerikGridView:GridViewDataColumn.CellEditTemplate
>
</
telerikGridView:GridViewDataColumn
>
public
class
Person
{
public
int
Age {
get
;
set
; }
public
bool
ThisRowIsFullyEditable {
get
;
set
; }
}
So.. can I by using the "ThisRowIsFullyEditable" property make the column Age editable or not for each row individually?
Thanks // David