Cannot update cell

8 posts, 0 answers
  1. Fairoz
    Fairoz avatar
    11 posts
    Member since:
    Jul 2011

    Posted 04 Mar 2013 Link to this post

    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?

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 Mar 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Fairoz
    Fairoz avatar
    11 posts
    Member since:
    Jul 2011

    Posted 05 Mar 2013 Link to this post


    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.
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 Mar 2013 Link to this post

    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.

  6. Fairoz
    Fairoz avatar
    11 posts
    Member since:
    Jul 2011

    Posted 05 Mar 2013 Link to this post

    Nope........ no styles defined for the editing element. Should I do so?
  7. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Mar 2013 Link to this post

    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.

  8. Fairoz
    Fairoz avatar
    11 posts
    Member since:
    Jul 2011

    Posted 06 Mar 2013 Link to this post

    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?
  9. Robin
    Robin avatar
    1 posts
    Member since:
    May 2016

    Posted 13 Jun Link to this post

    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.

     

     

Back to Top
UI for WPF is Visual Studio 2017 Ready