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

Grid as Excel: Auto edit mode etc

13 Answers 354 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lovsten
Top achievements
Rank 1
Lovsten asked on 15 Oct 2007, 07:18 AM
I'd like to use the grid like Excel.

1. As soon as the user selects a datacell it goes into edit mode (not using F2 or key stroke to enter edit mode). Is this possible?
2. When the user press Enter key, move to next datacell  (and go in to Edit mode of course)
3. When in datacell and end of text and user press Right arrow key, move to next datacell  (and go in to Edit mode of course)
4. When in datacell and beginning of text and the user press Left arrow key, move to previous datacell (and go in to Edit mode of course)

Everything to get the grid to act as Excel.

13 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 16 Oct 2007, 11:39 AM
Hi Lovsten,

Unfortunately, the RadGridView is designed to behave as much as possible in compliance with the standard Microsoft DataGridView. Currently there is no way to enforce it to act as the grid in Excel.

It is possible only to implement the behavior of your first question using the CellClick event and the BeginEdit() method of the RadGridView. However we constantly extend the capabilities of our grid control and we'll have in mind such scenarios in the future releases.

Greetings,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Lovsten
Top achievements
Rank 1
answered on 16 Oct 2007, 12:22 PM
Well Excel or MS DataGrid act pretty much the same. We were using MS Datagrid before moving to your control and there was no problem doing this i MS datagrid.

CellClick is fine, but what if the user uses navigation keys to select cell.
0
Georgi
Telerik team
answered on 16 Oct 2007, 05:16 PM
Hi Lovsten,

We agree with you that MS DataGridVIew could also be set up in a manner that its default behavior is similar to the Excel's grid. However, the editors' logic and the API of our grid is still under development, and unfortunately, there are some glitches that interfere with your case.
 
As to selecting with the navigation keys, CurrentRowChanged and CurrentCellChanged could be used. However this will not handle the Left/Right keys when the editor is opened.
 


Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Lovsten
Top achievements
Rank 1
answered on 17 Oct 2007, 05:26 AM
Are these glitches planned to be fixed in 2007 Q3 release?
0
Vassil Petev
Telerik team
answered on 22 Oct 2007, 07:00 AM
Hi Lovsten,

We're constantly working on improving the RadGridView control and we hope it will be much improved in the next major release (Q3 2007).  However, the chances are slim to offer a spreadsheet control for Q3 2007.

 
Regards,
Rob
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Dan
Top achievements
Rank 1
answered on 16 Dec 2008, 03:10 PM
Has any of this been addreses in the current release?
0
Nick
Telerik team
answered on 18 Dec 2008, 04:56 PM
Hello Dan,

Thank you for your question.

1. As soon as the user selects a datacell it goes into edit mode (not using F2 or key stroke to enter edit mode). Is this possible?

If you click with the mouse, the cell enters edit mode. If you navigate up or down with the keyboard, the behavior depends on whether or not you have entered edit mode before initiating the action. It takes one more click to enter edit mode in the DataGridView control and if you are in edit mode you escape that mode when you navigate with the keyboard up and down keys.

2. When the user press Enter key, move to next datacell  (and go in to Edit mode of course)

Here the behavior is different from the DataGridView - pressing enter in the DataGridView moves you to the next row while in the RadGridView the cell just escapes the edit mode.

3. When in datacell and end of text and user press Right arrow key, move to next datacell  (and go in to Edit mode of course)

That works.

4. When in datacell and beginning of text and the user press Left arrow key, move to previous datacell (and go in to Edit mode of course)

Works too.

Do not hesitate to write me back if you have more questions.

Regards,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Matt
Top achievements
Rank 1
answered on 31 Mar 2009, 02:16 PM
Hello:

Are there any samples in the current release that demonstrate a excel-like keyboard editing mode for your ASP.NET grid, describing the events that need to configured for this to happen, as well as a button for a user to submit their changes to the server ( as a batch) when they are finished?

At a minimum it would be good to know how to configure so that the user could click once to enter edit mode and then when the client-side editing has completed, a batch submit button that would send the updated data to the server using JSON.

Thanks,
Matt
0
Sebastian
Telerik team
answered on 31 Mar 2009, 02:53 PM
Hello Matt,

I think that the sample project from the following code library thread can be a good starting point for you:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/excel-like-radgrid.aspx

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
MP
Top achievements
Rank 1
answered on 14 Oct 2009, 03:12 PM
Dear Telerik,

I am using the RadGridView control in one of my application and I like the current behaviour where 1st click just selects the cell and then the 2nd click puts the cell in Edit-Mode. However, there's a slight difference in the way it works from the MS Datagridview which causes the users to be confused (in the multi-select with cell-select mode).

In the MS DataGridView, the cell is put in Edit Mode on mouse button up (release) instead of immediately on mouse button down. The advantage of this feature is the fact that I can still select a group of cells. In your current implementation, if a cell is already selected (highlighted), I cannot start the multi-select from within the same cell (as it immediately puts it in the edit mode).

Is there a way to handle this scenario such that the cell only goes into edit mode when the user releases the mouse button? This will be a great help! and a nice feature on your great control.

Regards,
MP
0
Jack
Telerik team
answered on 19 Oct 2009, 11:57 AM
Hi MP,

Thank you for your suggestion. We try to keep RadGridView behavior similar to MS DataGridView. So, we will consider your suggestion when planning our future releases. Unfortunately, it is not possible to change the behavior in the current version.

I updated your Telerik points accordingly. Should you have any other questions, don't hesitate to contact us.

Greetings,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
MP
Top achievements
Rank 1
answered on 19 Oct 2009, 04:17 PM
Hi Jack,

Thanks for the quick response. Yes, I would appreciate your bringing some of the easier to use features on the MS Datagrid especially on the multi-select cells. I have been getting this feedback from my user community a lot. They love all the new features on the grid. But would prefer to move back to the MS Datagrid control on screens that employ the multi-select cells functionality. Hope to see improvements on this area soon. Thanks. Let me know if you need any more details on this.

Thanks,
MP
0
Jack
Telerik team
answered on 20 Oct 2009, 12:44 PM
Hello MP,

I found a way to suppress edit mode on mouse down. You have to inherit from RadGridView and override its OnMouseDown method. Here is the code:

public class MyRadGridView : RadGridView
{
    bool beginEdit;
    bool mouseIsDown;
    Point mouseDownPoint;
 
    public override string ThemeClassName
    {
        get { return typeof(RadGridView).FullName; }
        set {}
    }
 
 
    protected override void OnMouseDown(MouseEventArgs e)
    {
        mouseDownPoint = e.Location;
        mouseIsDown = true;
        base.OnMouseDown(e);
        mouseIsDown = false;
    }
 
    protected override void OnMouseUp(MouseEventArgs e)
    {
        if (e.Location == mouseDownPoint && beginEdit)
        {
            BeginEdit();
        }
        base.OnMouseUp(e);
        beginEdit = false;
    }
 
    public override bool BeginEdit()
    {
        if (mouseIsDown)
        {
            beginEdit = true;
            return false;
        }
        return base.BeginEdit();
    }
}

I hope it helps.

Regards,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Lovsten
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Lovsten
Top achievements
Rank 1
Vassil Petev
Telerik team
Dan
Top achievements
Rank 1
Nick
Telerik team
Matt
Top achievements
Rank 1
Sebastian
Telerik team
MP
Top achievements
Rank 1
Jack
Telerik team
Share this question
or