title: MVC 3 telerik grid edition mode
body: <p>on one of my views i am using teleriks open source grid for MVC 3. i have 3 columns in the grid : </p>
  
  <p>-Name
  -Email
  -Roles</p>
  
  <p>the problem which ive got is: i want my Roles column as a dropdownlist, which is already editable when page load (so i dont want any Edit/Update buttons or stuff), so when admin change selected item in dropdownlist  role of user gonna be updated. </p>
  
  <p>Any idea how to make that? </p>
  
  <p><strong>View</strong> </p>
  
  <pre><code>@model IEnumerable&lt;UserViewModel&gt;
      @(Html.Telerik().Grid(Model)
            .Name("Grid").TableHtmlAttributes(new { width="800"})
              .Columns(columns =&gt;
              {
                  //if (userIsInWhateverRole){
                  //    columns.Template(o =&gt; Html.Action(GenerateYourLinkStuffHere));
                  //}
                  columns.Bound(o =&gt; o.Name).Width(150);
                  columns.Bound(o =&gt; o.Email).Width(120);
                  columns.Bound(o =&gt; o.Roles).Width(120);
              })
              .Sortable()
              .Scrollable()
              .Groupable()
              .Filterable()
              .Pageable(paging =&gt;
                  paging.PageSize(5)
                        )
                            )
  </code></pre>
  
  <p><strong>ViewModel</strong></p>
  
  <pre><code>public class UserViewModel
  {
  
      public int Id { get; set; }
  
      [Microsoft.Build.Framework.Required]
      [Display(Name = "User name")]
      public string Name { get; set; }
  
      [Required]
      [DataType(DataType.Password)]
      [Display(Name = "Password")]
      public string Password { get; set; }
  
      public string[] Roles { get; set; }
  
      public string Email { get; set; }
  
      public bool Admin { get; set; }
  
  }
  </code></pre>
  
  <p><strong>Control</strong></p>
  
  <pre><code>public ActionResult ManageRoles()
  {
      var users = Membership.GetAllUsers().Cast&lt;MembershipUser&gt;().Select(x=&gt; new UserViewModel{ Name = x.UserName, Email = x.Email, Roles = Roles.GetAllRoles()});
  
      return View(users);
  }
  </code></pre>