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

[Solved] In Place Editing

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christopher Borys
Top achievements
Rank 1
Christopher Borys asked on 09 Nov 2009, 02:26 AM
There has to be a better way to switch between view and edit mode than looping around for each item in the grid such as:
    foreach (GridDataItem item in grid.MasterTableView.Items)

        item.Edit =

true;

The above code assumes that all items are already there which requires databind() or rebind() and after the loop another rebind().
There should be a way to turn the whole grid into an edit mode (when editing in place) so that all editable columns turn into appropriate editors.  Also, there should be a way to turn certain column into edit mode on and off.  After that, one call to rebind() should be sufficient.

Also, I don't know whether this is a bug or what but with one of my specific test case data and above code, all records (rows / items) turn into edit except the first one.  So, I know that the logic to switch to edit mode depends somehow on data which is fundamentally wrong.  When I nail what exactly it is, I will post  a specific example.  Meanwhile, maybe someone has a better approach?

Thank you,
Chris




1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Nov 2009, 12:12 PM
Hi Christopher,

Have you tried following code in order to put all the rows in EditMode on page load?

CS:
 
   protected void Page_Load(object  sender, EventArgs e) 
   { 
        for (int i = 0; i < RadGrid1.PageSize; i++) 
       { 
           RadGrid1.EditIndexes.Add(i); 
       } 
   } 

Regards,
Shinu.
Tags
Grid
Asked by
Christopher Borys
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or