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

Cannot update cell

7 Answers 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Fairoz
Top achievements
Rank 1
Fairoz asked on 05 Mar 2013, 04:55 AM
Hi,

I have a RadGridView as shown in the below code

 

<telerik:RadGridView Name="radGV_Library" AutoGenerateColumns="False"  ItemsSource="{Binding ListOfLibraryObjects}" ShowGroupPanel="False" SelectionChanged="radGV_Library_SelectionChanged" CanUserSortColumns="False" CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="False">
    <telerik:RadGridView.Columns>
        <!--<telerik:GridViewSelectColumn/>-->
        <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" IsFilterable="False" >
        <telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Description}" IsFilterable="False"  IsReadOnly="True"/>
        <telerik:GridViewDataColumn Header="Is Master" DataMemberBinding="{Binding IsMaster}" IsFilterable="False"  IsReadOnly="True" />
        <telerik:GridViewDataColumn Header="Object ID" DataMemberBinding="{Binding ObjectID}" IsFilterable="False"  IsReadOnly="True"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

 

 
The GridView is in a user control and the data context is passed to the user control it as below
 

public void RefreshDataContext(VOC.Models.TheGameScreenM _theGSM) 
    this.DataContext = null; 
    this.DataContext = _theGSM; 
}

 
The GridView loads and refreshes with no problem. But I cannot edit the first column (the name column, which is string data). When the cell gets into edit mode, only the "space" and "back space" works. No other keys on the keyboard works to update the cell content. But however, the paste from right-click context menu works. So if I copy a text from somewhere and paste it in the cell, then that works.

I have tried
1. Mode = TwoWay
2. DataType = "{x:Type sys:String}"

nothing works!

Why is that?

7 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 05 Mar 2013, 09:10 AM
Hello,

Is the Name property editable? What is the type of the bound collection?

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Fairoz
Top achievements
Rank 1
answered on 05 Mar 2013, 09:41 AM

The bound collection is an ObservableCollection of the LibraryObjectM shown below.

public class TheGameScreenM
{
    ObservableCollection<LibraryObjectM> listOfLibraryObjects = new ObservableCollection<LibraryObjectM>();
    public ObservableCollection<LibraryObjectM> ListOfLibraryObjects
    {
        get
        {
            return listOfLibraryObjects;
        }
    }
}


public class LibraryObjectM : Telerik.Windows.Controls.ViewModelBase
 
    string name = "No Name";
    public string Name
    {
        set
        {
            name = value;
            OnPropertyChanged("Name");
        }
        get
        {
            return name;
        }
    }
}

Its TheGameScreenM object is then set as the DataContext of the user control in which the GridView is placed.

I tried List<> and ObservableCollection<> but only text entry from the keyboard is ignored.
0
Dimitrina
Telerik team
answered on 05 Mar 2013, 01:24 PM
Hello,

The default editor of the GridView is TextBox. Have you defined any Style for this element restricting keyboard input for keys different than the "space" and "back space" keys.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Fairoz
Top achievements
Rank 1
answered on 06 Mar 2013, 12:42 AM
Nope........ no styles defined for the editing element. Should I do so?
0
Dimitrina
Telerik team
answered on 06 Mar 2013, 01:22 PM
Hello,

This would not be an expected behaviour. May I ask you to isolate the problem in a demo project and send it to us to investigate the case in details? You can check this blog post for a reference. 

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Fairoz
Top achievements
Rank 1
answered on 07 Mar 2013, 01:32 AM
How can I send the sample project? The support for this account has expired and I have a zip file with the solution in it to send?
0
Robin
Top achievements
Rank 1
answered on 13 Jun 2016, 04:20 PM

Has anyone found out the problem, and a solution?  I am facing exactly the same problem. It is kind of hard for me to send over a sample project though because our solution is very complicated with a lot of custom controls.

 

 

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