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

How to select a cell for edit mode from code?

2 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 09 Feb 2011, 08:30 PM
Hey,
    I am doing a lot of calculations to the grid through code and it is real slow if I don't use grid.beginupdate() & grid.endupdate(). However, when i call these I lose the edit of the selected cell. Oh well, so i store the current cell information and try to set it to edit after all the calculations have been done:


 

Me.gvRoomNights.Rows(_LastRowIndex).Cells(_LastColIndex).BeginEdit()

However this doesn't seem to work. Actually it never really loses edit, if you type it will edit. However, it doesn't look like it is in edit mode. For example, it is not white and no cursor.

Another,
    When I call, grid.beginupdate() & grid.endupdate(), the gird loses all of its cell formatting as far as backcolor.

Thanks in advance

Eric

 

2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 09 Feb 2011, 09:10 PM
Hello Eric,

The RadGridView Begin Update and End Update defers the refresh on the RadGridView, which is aimed at (for exmaple) when looping over Grid View rows and updating values. It will, as you say, drastically enhance performance to use either

Me.RadGridView1.BeginUpdate()
' Do something
Me.RadGridView.EndUpdate()
or
Using Me.RadGridView1.DeferRefresh()
' Do something
End Using

If you would care to post a sample of what you are wanting to achieve that replicates your current behaviour, I'll be happy to try and help
Regards,
Richard
0
Svett
Telerik team
answered on 11 Feb 2011, 05:05 PM
Hi Eric,

I would kindly ask to give us more details about  what requirements that you have. In what case are you invoking the BeginEdit method? It will be nice if you share with us code snippets that demonstrate your needs.
 

Best wishes,
Svett
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Eric
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Svett
Telerik team
Share this question
or