This is a migrated thread and some comments may be shown as answers.

Request for sample grid control

2 Answers 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 06 Jul 2015, 05:23 PM

I am writing a new WPF application.  I am currently using a control from another vendor and I am unable to achieve the functionality described below.  Before I get too far down the road I want to make sure I am using controls that will function per my design requirements.  I would like to know if it is possible implement a grid with the features described below using the Telerik grid control for WPF.
In short, what I want to implement is explicit save and cancel functionality for each row in the grid.  If the user edits a row I want them to have to click a Save button before their changes are written to disk.  Also, I want to display a cancel button that will undo any edits.  Can you show me a grid control that implements this??
When the grid is initially displayed I want each row to display a Delete button in the rightmost column.
When the user starts to edit a certain row, I want to hide the Delete button and replace it with two buttons: Save and Cancel.
User must be able to use the tab key to navigate to Save and Cancel buttons.
User can click a column in any row and begin editing i.e. no Edit button.

Default values are visible for all columns in new item row upon editing.

Delete button is shown for all rows except new row (ideally a binding).

Upon editing, Save and Cancel buttons become visible (ideally a binding so that Save becomes visible only when data is valid).

Tab key:  Save, Cancel and Delete buttons receive focus when tabbed to.  Pressing tab key while in edit mode moves cursor from data last column to Save, then to Cancel, then wraps back to first data column of same row.  Buttons show correct styling when focused.Save and Cancel click behavior:  if row is an update to an existing row, edit mode is ended and focus stays on current row.  If an insert (user is editing new item row), edit mode is maintained and focus is moved to first column of new item row.Pressing Esc key has the same effect as clicking Cancel (ideally fires same command).

Save, Delete, Cancel buttons can bound to viewmodel commands.

Save, Delete, Cancel buttons share a common column or make efficient and attractive use of space.When editing, user cannot navigate to a different row unless changes to current row are saved or cancelled.

 

Thank you

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 09 Jul 2015, 01:58 PM
Hello Sam,

We provide plenty of resources that can help you get started with the controls in the suite. I suggest checking some of the listed below:
- The online documentation is located at http://docs.telerik.com/devtools/wpf/controls/radgridview/overview2. It contains extensive information about each of the controls, its features, extensibility points and so on.
-  The SDK Repository on GitHub is a developer-oriented resource. You could also try out the SDK Browser that allows you to browse, run or open in Visual Studio each demo.
- The WPF demos show some common uses of each of the controls.

More specifically:
- in order to implement explicit save and cancel functionality you can check the approach from the Commands WPF Demo.

If you want to be able to discard the changes out-of-the-box, your business object should implement the IEditableObject Interface. You can check this msdn article as a reference.

- in order to display a Delete button in the rightmost column, you should redefine the CellTemplate of the columns as illustrated on the Commands demo. You can also refer to the documentation on: Setting CellTemplate and CellEditTemplate.

- Upon editing, Save and Cancel buttons become visible -> Commands demo.

- Keyboard navigation -> Keyboard Support article. In case you need to override the default behavior, you can define your own Keyboard Command Provider.

- The Esc key will fire the CancelCellEdit or CancelRowEdit commands depending on which element edit just ended. You can also refer to the Commands Overview article. 

- You can bind the Buttons to Commands in ViewModel, you just may need to ensure the correct Source for the Binding is specified. Please note cell's DataContext is the bound data item and not the parent RadGridView.DataContext. You can also check the blog on: How to use Commands in WPF.

- When editing, user cannot navigate to a different row unless changes to current row are saved or cancelled. - RadGridView supports editing of a single cell at a time, so the user should not be able to navigate away before committing. You can also check the Validation options.

Regards,
Dimitrina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Sam
Top achievements
Rank 1
answered on 09 Jul 2015, 02:20 PM

Thank you for your definitive answer.

Regards,

Sam

Tags
GridView
Asked by
Sam
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Sam
Top achievements
Rank 1
Share this question
or