You can see the following link for searching, filtering and sorting in mvc4 grid data
http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application
For dropdown selected index you have to use jquery
@Html.DropDownListFor(model => model.StateID, Enumerable.Empty<SelectListItem>(), "--Select State--")
<script type="text/javascript">
$('#CountryID').change(function () {
var selectedCountry = $(this).val();
if (selectedCountry != null && selectedCountry != '') {
$.getJSON('@Url.Action("GetStates")', { CountryID: selectedCountry }, function (states) {
var statesSelect = $('#StateID');
statesSelect.empty();
statesSelect.append($('<option/>', {
value: 0,
text: '--Select State--'
}));
$.each(states, function (index, state) {
statesSelect.append($('<option/>', {
value: state.value,
text: state.text
}));
});
});
}
});
</script>
public ActionResult GetStates(int CountryID)
{
List<State> states = db.States.Where(a => a.CountryID == CountryID).ToList();
return Json(
states.Select(x => new { value = x.StateID, text = x.StateName }),
JsonRequestBehavior.AllowGet);
}