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

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

2 Answers 85 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 30 Mar 2012, 09:36 PM
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 Answers, 1 is accepted

Sort by
0
Ken
Top achievements
Rank 1
answered on 30 Mar 2012, 09:42 PM
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.
0
Jack
Telerik team
answered on 02 Apr 2012, 10:40 AM
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 >>
Tags
GridView
Asked by
Ken
Top achievements
Rank 1
Answers by
Ken
Top achievements
Rank 1
Jack
Telerik team
Share this question
or