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

Editing a large amount of checkboxes with batch update on server

1 Answer 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phillip Martin
Top achievements
Rank 1
Phillip Martin asked on 28 Jul 2010, 11:48 PM
All,
   I'm new to the Telerik controls (and loving them so far) - so please bear with me. I couldn't find a suitable answer by searching the forums, but I apologize if a similar question has been asked elsewhere.

I'm looking for guidance on the best way to achieve this.

I have a client who has a very strong urge for this application to work a certain way, and I know it's not typically how grids are edited/used, but if at all possible this is the situation I'm trying to code for (in Visual Studio 2008):

I have a RadGrid, defined in the aspx page, with no columns specified at design time.

At runtime, I'm loading a set of data that will have a variable number of columns.  there will be 1-2 columns of read-only textual data, and then a variable number of columns of nothing but checkboxes.  This is all that is contained in the grid.   The user should be able to select/unselect each checkbox, and when satisifed with their data they will then hit a submit button, at which point I will store all changes in one go.
basic layout looks a little like this:
            col1  col2   col3   col4   col5
ROW1             [x]   [x]    [ ]    [ ]    [ ]
ROW2             [ ]   [ ]    [x]    [ ]    [ ]
ROW3             [x]   [ ]    [ ]    [ ]    [ ]
ROW4             [ ]   [ ]    [ ]    [x]    [ ]


 This differs from typical grid-editing usage in that client absolutely refuses to click an 'edit' command button to put the row in an edit state, followed by a save button to end the edit session.  Too many clicks for what will be hundreds of checkboxes.

I started off using the examples listed here, defining a custom template to be used by the checkbox columns, however when I attempt to iterate through the MasterTableView Items collection, or through just the grid's item collection, calling FindControl with the proper name does not seem to return anything.   At this point, I'm not even that concerned about tracking only what changed (although that'd be nice) - If I could just get the checked value for each box for each row in the grid I'd be happy.

One complication may be that I'm running this in a Master Pages environment - if this is a known problem, I can back out of that design and leave it as a standalone page.

If anyone has any advice, I'd be most appreciative.

1 Answer, 1 is accepted

Sort by
0
Phillip Martin
Top achievements
Rank 1
answered on 29 Jul 2010, 05:30 AM
I did some more digging, and found that If I removed the Microsoft AJAX script manager from the master page, and replaced it with only Telerik items, now I can investigate by control name.  I'm guessing the mixture of MS Ajax components and Master Pages was messing with the controls naming or lifecycle.

Still, if anyone has a better concept on how to easily track changes in this scenario, I'd love to hear it.
Tags
Grid
Asked by
Phillip Martin
Top achievements
Rank 1
Answers by
Phillip Martin
Top achievements
Rank 1
Share this question
or