This question is locked. New answers and comments are not allowed.
Hello,
I have a grid of this type;
When the user clicks on the cell "Edit" the button "Cancel" appears and the Row should turn on editable. The cursor should be also placed on the first row (PrixBase in this exemple).
For the moment the control associated to the "Edit" button is:
If I write radGridViewBaseTarification.IsReadOnly == false all the grid view is editable. How can I only set my selected line editable?
And how can I place the cursor over the cell "Prix base" for the row I want to edit? I've read some of the samples in the forum but in all of them the user places the cursor on a specific row (22 for exemple)
Thanks for your help
I have a grid of this type;
<views:PricingRadGridView x:Name="radGridViewBaseTarification" Grid.Row="1" IsBusy="True" AutoGenerateColumns="False" RowEditEnded="radGridViewBaseTarification_RowEditEnded" DataLoaded="radGridViewBaseTarification_DataLoaded" > <views:PricingRadGridView.Columns> <telerikGridView:GridViewDataColumn HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}" IsVisible="False" UniqueName="EditColumn"> <telerikGridView:GridViewColumn.CellTemplate> <DataTemplate> <telerik:RadButton Content="Edit" Style="{StaticResource RadButtonHyperlinkStyle}" Click="RadButtonEdit_Click" x:Name="RadButtonEdit"/> </DataTemplate> </telerikGridView:GridViewColumn.CellTemplate> </telerikGridView:GridViewDataColumn> <telerikGridView:GridViewDataColumn HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}" IsVisible="False" UniqueName="CancelEditColumn"> <telerikGridView:GridViewColumn.CellTemplate> <DataTemplate> <telerik:RadButton Content="Cancel" Style="{StaticResource RadButtonHyperlinkStyle}" Click="RadButtonEdit_Click" x:Name="RadButtonCancelEdit"/> </DataTemplate> </telerikGridView:GridViewColumn.CellTemplate> </telerikGridView:GridViewDataColumn> <telerikGridView:GridViewDataColumn Header="Prix Base" HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}" DataMemberBinding="{Binding PrixBase}" x:Name="CellPrixBase" /> </views:PricingRadGridView.Columns></views:PricingRadGridView>When the user clicks on the cell "Edit" the button "Cancel" appears and the Row should turn on editable. The cursor should be also placed on the first row (PrixBase in this exemple).
For the moment the control associated to the "Edit" button is:
private void RadButtonEdit_Click(object sender, RoutedEventArgs e) { RadButton myClickedButton = (RadButton)sender; if (radGridViewBaseTarification.IsReadOnly == true) { //the user can edit now the gridview //radGridViewBaseTarification.IsReadOnly = false; myClickedButton.Content = "Save Changes"; RadGridViewBaseTarification.Columns["CancelEditColumn"].IsVisible = true; } else//the user wants to save the changes
{ myClickedButton.Content = "Edit"; radGridViewBaseTarification.IsReadOnly = true; //save changes in the DB }If I write radGridViewBaseTarification.IsReadOnly == false all the grid view is editable. How can I only set my selected line editable?
And how can I place the cursor over the cell "Prix base" for the row I want to edit? I've read some of the samples in the forum but in all of them the user places the cursor on a specific row (22 for exemple)
Thanks for your help