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

[Solved] Showing a view instead of the default edit window in a grid

2 Answers 20 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Heath
Top achievements
Rank 1
Heath asked on 22 Sep 2011, 08:03 PM
The problem:

In my edit popup I want to show list of available roles users can be assigned to as an array of checkboxes in check the roles a user already belongs to. The list of roles is dynamic and comes from the database and thus cannot be hard coded.

The grid would look something like:

User Name | Roles
Bob            | Admin,ReadWrite,ReadOnly
Tom            | ReadOnly

So the pop-up would look something like:

User Name: Bob
Roles:
[x ] Admin
[x ] ReadWrite
[x ] Readonly

I don't see this supported inherently by the mvc grid control so I've been trying to find a suitable work around.

I was thinking that overriding the OnEdit event of the grid might allow me to replace the content of the edit popup with a view. I've used a similar method in the asp.net radgrid using radwindows fired by the edit command... surely someone's already run into this and has a workable solution?

2 Answers, 1 is accepted

Sort by
0
Heath
Top achievements
Rank 1
answered on 22 Sep 2011, 10:52 PM
My current web trudging has lead me to believe that my answer lies somewhere in Display/EditorTemplates. If I manage to figure this out I'll post the solution here.
0
Heath
Top achievements
Rank 1
answered on 26 Sep 2011, 10:22 PM
Unfortunately this solution is leaving me high and dry as the display/editor templates don't work with ajax binding.
Tags
Grid
Asked by
Heath
Top achievements
Rank 1
Answers by
Heath
Top achievements
Rank 1
Share this question
or