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

[Solved] Static DropDownList when editing mvc grid

0 Answers 16 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.
Justin
Top achievements
Rank 1
Justin asked on 01 Nov 2012, 07:52 PM

I'm trying to add a static  dropdown list containing the items "Y" and "N" to my Active column when in edit mode.  What is the simplest way to accomplish this? 

 

@(Html.Telerik().Grid(

 new List<Principal>())

 .Name(

 "Users")

 .DataKeys(d =>

{

d.Add(p => p.UserName);

})

.ToolBar(commands => { commands.Insert().ButtonType(

 GridButtonType.Text); })

 .DataBinding(binding =>

{

binding.Ajax()

.Select("Index_Ajax", "UserProfiles")

.Insert("Create", "UserProfiles")

 .Update("Update", "UserProfiles");

})

.Columns(columns =>

{

columns.Bound(p => p.UserName).Width(125);

columns.Bound(p => p.OutlookName);

columns.Bound(p => p.EmailAddress).Width(200);

columns.Bound(p => p.NTUserName).Title("NT ID");

columns.Bound(p => p.EmployeeID).Title("Emp. ID").Width(100);

 columns.Bound(p => p.NewUserRemedyTicket).Title("New Usr Tkt #");

 columns.Bound(p => p.DropUserRemedyTicket).Title("Drp Usr Tkt #");

 columns.Bound(p => p.DeactivateUser).Title("Deact. By").ReadOnly(true);

 columns.Bound(p => p.DeactivateDate).Title("Deact. Date").ReadOnly(true).Format("{0:yyyy-MM-dd}");

columns.Bound(p => p.Active).Width(80);

columns.Command(commands =>

{

commands.Edit().ButtonType(GridButtonType.Text);

});

})

.Editable(editing =>

{

editing.Mode(GridEditMode.InLine);

 editing.DefaultDataItem(new Principal(""));

})

.ClientEvents(events =>

{

events.OnSave("block");

events.OnComplete("unblock");

events.OnRowSelect("UserGrid_OnSelect");

events.OnEdit("UserGrid_onEdit");

})

.Selectable()

.Sortable()

.Pageable()

.Filterable()

)

Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Share this question
or