title: Get Values of DropDownList which is inside webgrid and also each dropdown is an attribute of the model
body: <p>I have a webgrid contains a dropdown which contains different items for each user(Items are grouped). I want to get the selected values to the controller . How can I do that. Heres my ;</p>
  
  <p>Model :</p>
  
  <pre><code>public SelectList AvailableDevices { get; set; }
  </code></pre>
  
  <p>View :</p>
  
  <p>...</p>
  
  <pre><code> var grid = new WebGrid(Model. ...
  ..
  ..
  
   grid.Column(header: "AvailableDevices", format: @item =&gt; Html.DropDownList("value", (IEnumerable&lt;SelectListItem&gt;)item.AvailableDevices)),
  </code></pre>
  
  <p>And I have a Submit Button </p>
  
  <pre><code>@using (Html.BeginForm("AssignUserDevices", "Device"))
  {
      &lt;input type="submit" value="setUserDevice" onchange="CheckSelectedDevices()" /&gt;
  }
  </code></pre>
  
  <p>I want to set users device according to his user type. I know what his choices and send dropdown items according to his type. So each item in webgrid differs from each other.</p>
  
  <p>And Also I dont know how to give indices to each item in webgrid.( I think we will need it.)</p>
  
  <p>Im new at MVC so hope you will understand.</p>
  
  <p>Thanks;</p>