Hi!
I have a GridView with a button above it declared like this:
As default, the button is disabled when the GridView is in edit mode. I always want it enabled so the user can click it even when editing another row. In that case the current row should be commited and a new row is added.
My solution to this was to use the IsEnabledChanged event of the button and the set it back to enabled.
This seems to work, but is there a better solution?
I also have a delete row button inside the grid declared like this:
And I tried to do the same there. The button stays enabled, but nothing happens when I click it if the row is in edit mode.
How can I get around this?
Regards,
Håkan
I have a GridView with a button above it declared like this:
<
telerik:RadButton
Command
=
"telerikGrid:RadGridViewCommands.BeginInsert"
CommandTarget
=
"{Binding ElementName=DataGrid}"
IsEnabledChanged
=
"ButtonAddRow_IsEnabledChanged"
/>
As default, the button is disabled when the GridView is in edit mode. I always want it enabled so the user can click it even when editing another row. In that case the current row should be commited and a new row is added.
My solution to this was to use the IsEnabledChanged event of the button and the set it back to enabled.
This seems to work, but is there a better solution?
I also have a delete row button inside the grid declared like this:
<
telerik:GridViewColumn
Width
=
"26"
IsReadOnly
=
"True"
TabStopMode
=
"Skip"
IsResizable
=
"False"
IsVisible
=
"{Binding IsReadOnly, ElementName=DataGrid, Converter={StaticResource BooleanInvertConverter}}"
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
telerik:RadButton
Command
=
"telerikGrid:RadGridViewCommands.Delete"
CommandParameter
=
"{Binding}"
IsEnabledChanged
=
"ButtonDeleteRow_IsEnabledChanged"
/>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewColumn
>
And I tried to do the same there. The button stays enabled, but nothing happens when I click it if the row is in edit mode.
How can I get around this?
Regards,
Håkan