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

Editable RadGridView Row

4 Answers 731 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Valerio
Top achievements
Rank 1
Valerio asked on 28 Jul 2010, 09:56 AM
Hi there

Here is my problem and I hope someone could help me please:
- How can I turn a RadGridView Row with all cells in edit view and validate all entries at once?
The problem with the RadGridView is that we can only turn editable a single cell from a column that is at ReadOnly = false.
If there is a solution, please informe me ;-)
Thx

Windows Vista
WPF
C#

Valerio

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 28 Jul 2010, 12:38 PM
Hi Valerio,

Please give us more specifics about your scenario and mainly the purpose of setting a whole row in edit-mode as for the time being only one cell can be in this mode. 
You can find detailed information about editing in RadGridView in our online documentation.


Regards,
Maya
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Valerio
Top achievements
Rank 1
answered on 28 Jul 2010, 01:59 PM
Hi Maya.

The problem is that I'm generating a new kind of Column (Custom column that inherites from GridViewBoundColumnBase) to
present Custom Controls into the GridViewCells(in EditMode).
For Example: I use in this case for a specific Column a custom control that is called "GenericText".

public override FrameworkElement CreateCellEditElement(Telerik.Windows.Controls.GridView.GridViewCell cell, object dataItem)
        {
            this.BindingTarget =GenericText.currentValueProperty;                      
            var text = new GenericText();                    
            text.Foreground = Brushes.Black;          
            text.SetBinding(this.BindingTarget, this.CreateValueBinding());
            return text;
        }
private Binding CreateValueBinding()
        {
            var valueBinding = new Binding();
            valueBinding.Mode = BindingMode.TwoWay;
            valueBinding.NotifyOnValidationError = true;
            valueBinding.ValidatesOnExceptions = true;
            valueBinding.UpdateSourceTrigger = UpdateSourceTrigger.LostFocus;
            valueBinding.Path = new PropertyPath(this.DataMemberBinding.Path.Path);
            return valueBinding;
        }

I created diferents types of columns with controls like GenericDateTime, GenericBoolean, and I wish if it is
possible to present directly those controls with the edit mode, "all of them in a single row".
I wanted to switch a Row from View mode into Edit mode and Having the possibility to validate all entries (at once) or cancel
to come back into View mode.
I can't do it with Datatemplate because I need to have binding (twoWay) beetwin the Cells(ViewMode) and the controls(EditMode)
of the row I selected.
I hope I've been more specific ;-)
0
Maya
Telerik team
answered on 29 Jul 2010, 04:19 PM
Hi Valerio,

Unfortunately, even in this case it is not possible to keep all cells in a row in edit-mode simultaneously.
Depending on your requirements, a possible approach may be to create the CellElement in the same manner as your CellEditElement. However, in this case every cell will keep its look as if in edit-mode permanently.
Furthermore, what exactly are the purpose and your expectations from "validating all entries (at once)"? In case it is appropriate for your application, you may use Data Validation on a Row Level. More information about this approach could be found in our online documentation.

 

Kind regards,
Maya
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Valerio
Top achievements
Rank 1
answered on 29 Jul 2010, 07:00 PM
I had an idea.. I will give to my custom controls Edit and View mode, use GridViewDataColumn as inheritance, and use (as button) a specific cell to switch all controls from view to edit and edit to view mode.

thx for the tip Maya ;-)
Tags
GridView
Asked by
Valerio
Top achievements
Rank 1
Answers by
Maya
Telerik team
Valerio
Top achievements
Rank 1
Share this question
or