Hi,
I have list of users (List<User>) binded to a grid. I have a currently logged in user information in ViewData[User].
What I want is if a grid contains a user which is in ViewData. I want that user to be selected as soon as grid loads data. How can I do this validation ? How can I get currently selected row ?
@(Html.Kendo().Grid<KendoGridAjaxBinding.Models.User>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax() // Specify that ajax binding is used
.Read(read => read.Action("User_Read", "Home")) // Set the action method which will return the data in JSON format
)
.Columns(columns =>
{
columns.Bound(user=> user.UserID);
columns.Bound(user=> user.UserName);
columns.Bound(user=> user.City);;
})
.Pageable() // Enable paging
.Sortable() // Enable sorting
)
I have list of users (List<User>) binded to a grid. I have a currently logged in user information in ViewData[User].
What I want is if a grid contains a user which is in ViewData. I want that user to be selected as soon as grid loads data. How can I do this validation ? How can I get currently selected row ?
@(Html.Kendo().Grid<KendoGridAjaxBinding.Models.User>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax() // Specify that ajax binding is used
.Read(read => read.Action("User_Read", "Home")) // Set the action method which will return the data in JSON format
)
.Columns(columns =>
{
columns.Bound(user=> user.UserID);
columns.Bound(user=> user.UserName);
columns.Bound(user=> user.City);;
})
.Pageable() // Enable paging
.Sortable() // Enable sorting
)