First column "lost" off edge of grid when clicking second cell

3 posts, 0 answers
  1. Ken
    Ken avatar
    10 posts
    Member since:
    Sep 2011

    Posted 30 Mar 2012 Link to this post

    I have some grids that are behaving oddly.  They both have two columns/no headers, but the text of the columns is off the grid to the right.  For some reason there are no horizontal scroll-bars, which would be OK if the first column wasn't lost.  Anyway, see the two grids in the attachments.  The attachments are to illustrate the bottom grid before/after I click on the cell with text.

    Any ideas?
  2. Ken
    Ken avatar
    10 posts
    Member since:
    Sep 2011

    Posted 30 Mar 2012 Link to this post

    I just went through every property of the grid and I think I found the source of the problem.  It looks like the grid was set to never show the horizontal scroll bar.  I don't have the screen real estate for the scroll bar so I just manually set the min/max widths of the columns so they won't disappear.

    It would be nice to be able to use the cursor keys to move throughout the grid.
  3. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 02 Apr 2012 Link to this post

    Hi Ken,

    I am glad to hear that you have found a solution for the issue.

    When the user clicks on a cell, RadGridView tries to ensure that the whole cell will be visible. That is why it changes the horizontal scrollbar position (It looks that the second column on the bottom grid is longer than displayed on the first picture).

    Regarding the keyboard navigation, yes RadGridView support navigation between cells with the following keys: Left, Right, Up, Down, Tab, Shift+Tab, PgUp and PgDown. If you want to customize this navigation you can override the default grid behavior and handle its ProcessKey method:
    this.radGridView1.GridBehavior = new CustomGridBehavior();
     
    public class CustomGridBehavior : BaseGridBehavior
    {
        public override bool ProcessKey(KeyEventArgs keys)
        {
            if (keys.KeyCode == Keys.Home)
            {
                // do something
                return true;
            }
            return base.ProcessKey(keys);
        }
    }

    In case you have further questions, do not hesitate to contact us.
     
    Regards,
    Jack
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top