Hi All.
I am new to using the Telerik controls. I am exploring using the Grid Control and have figured out how to codoe popup window to create a new record.
The following code works below for the first Create button on the toolbar. On the grid toolbar - I want to have two "Create" buttons (see code below). I want both buttons to implement "Create" but displays a different custom popup form for each button.
Is there a way to implement a conditional "Create"? What is the best approach to implement this functionality?
Thank you,
Debby
<div id="divGridUser">
@(Html.Kendo().Grid(Model)
.Name("GridTest")
.Columns(columns =>
{
columns.Bound(p => p.UserId);
columns.Bound(p => p.UserType);
columns.Bound(p => p.UserName).Title("User Name");
columns.Bound(p => p.Provider).Title("Provider");
})
.ToolBar(toolbar =>
{
toolbar.Create().Text("Add Provider To Role").HtmlAttributes(new { id = "Provider"});
toolbar.Create().Text("Add Inside User Role");
})
.Editable(et => et.Mode(GridEditMode.PopUp).TemplateName("Users_Command"))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Model(model => model.Id(p=>p.UserId))
.Read(read => read.Action("UsersCommand_Read", "Popup"))
.Create(upd => upd.Action("UsersCommand_Create", "Popup"))
)
.HtmlAttributes(new { style = "height:550px;" })
.Pageable(pageagble => pageagble.Input(true).Numeric(false))
.Sortable()
.Filterable()
.Scrollable(scr => scr.Endless(true))
)
</div>