Hiearchical grid not work binding source events PositionChanged

6 posts, 0 answers
  1. Sari
    Sari avatar
    5 posts
    Member since:
    Sep 2011

    Posted 02 Sep 2011 Link to this post

    Hello
    When add

     

      dg.Relations.AddSelfReference(dg.MasterTemplate,"ID", "IDPARENT");

    The event bnds_PositionChanged works only when go with level on another.

    А within

    the one level does not work.

     

    Operation of the removing does not work too.

     

    Thanks!


  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 07 Sep 2011 Link to this post

    Hi Sari,

    I am not sure that I fully understand the issue. Could you, please send us your project and data. This will allow us to investigate the issue locally and provide you with accurate support. Thank you in advance.

    Looking forward to your reply.

    Greetings, Julian Benkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sari
    Sari avatar
    5 posts
    Member since:
    Sep 2011

    Posted 13 Sep 2011 Link to this post

    Hello
    BindingList<MyObj> blMyObj;
    public sealed class MyObj
    {
        #region "Declaration"          
        private int _Id;          
        private int _ParentId;
        private string _Name = "";
        private string _Description;
        #endregion
     
        #region "Property"                        
        public int Id
        {
            get { return _Id; }
            set { _Id = value; }
        }
                 
        public int ParentId
        {
            get { return _ParentId; }
            set { _ParentId = value; }
        }
                 
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
                     
        public string Description
        {
            get { return _Description; }
        }           
        #endregion
         
        public MyObj(int idObj,int ParentIdObj, string nameObj,string DescriptionObj)
        {
            _Id = idObj;
            if (ParentIdObj!=0) _ParentId = ParentIdObj;              
            _Name = nameObj;
            _Description = DescriptionObj;
        }
    }
     
    private void frm_Load(object sender, EventArgs e)
    {
        radGridView1.DataSource=bindingSource1;
        this.bindingSource1.PositionChanged += new System.EventHandler(this.bindingSource1_PositionChanged);
        blMyObj = new BindingList<MyObj>();
        blMyObj.Add(new MyObj(1,0, "Allen",""));
        blMyObj.Add(new MyObj(2,0, "Carolina", ""));
        blMyObj.Add(new MyObj(3,1, "Whitney", ""));
        blMyObj.Add(new MyObj(4,3, "Sarah", ""));
        blMyObj.Add(new MyObj(5,0, "Dun", ""));
        blMyObj.Add(new MyObj(6,5, "Tu-Lin", ""));
        blMyObj.Add(new MyObj(7, 6,"Alexandra", ""));
        blMyObj.Add(new MyObj(8,0, "Tammy", ""));           
        
        radGridView1.Relations.AddSelfReference(radGridView1.MasterTemplate, "Id", "ParentId");
        this.bindingSource1.DataSource = blMyObj;
     }
     
     private void bindingSource1_PositionChanged(object sender, EventArgs e)
    {
     
    }
    The Event bindingSource1_PositionChanged does not work correct. 
  5. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 14 Sep 2011 Link to this post

    Hello Sari,

    You already use a bindingList that supports collection change notifications, why do you need a bindings source to?

    Just set the datasource of the grid to that bindingList and delete will work
    radGridView1.DataSource = blMyObj;


    With the other issue, with the position change, it's strange, but honestly i cannot see a scenario where you might need it, because you always have the current row / the data bound item to that row...

    Best Regards,
    Emanuel Varga
  6. Sari
    Sari avatar
    5 posts
    Member since:
    Sep 2011

    Posted 14 Sep 2011 Link to this post

    Hello Emanuel,
    Using bindingList is just an example. This problem occurs with any data source.

    Also is not working properly displaying alternative rows.
    EnableAlternatingRowColor=true;
  7. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 15 Sep 2011 Link to this post

    Hello Sari,

    I logged the issues in our Public Issue Tracking System. The fixes will be available in one of our next releases.

    Thank you for reporting the issue. Your Telerik points have been updated.

    Kind regards,
    Julian Benkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WinForms is Visual Studio 2017 Ready