This question is locked. New answers and comments are not allowed.
Hi,
I'm having trouble getting a custom form to properly show up. In my index method I have an optional int.
So the only time I can get the Popup custom form to work is to have a parameterless Index method:
This won't work for us because we have a navigation bar on the left by which users navigate ProjectGroups and perform on the operations for the Projects for the ProjectGroup's. When the Edit button is clicked, the Grid control seems to pass the parameter of the selected Project (the datakey) into the URL along with some other stuff and this is where things break. A window tries to pop-up, but it actually doesn't contain anything so all you see is the "X" in the upper right of the modal to close it. I appreciate any advice anyone can offer. btw, here is how I'm creating my Grid:
I'm having trouble getting a custom form to properly show up. In my index method I have an optional int.
public
ViewResult Index(
int
? id)
{
IList<ProjectViewModel> projects =
new
List<ProjectViewModel>();
if
(id !=
null
)
{
//Only get projects for the project group id
}
else
{
//We're at the Index with no id parameter, get all the Projects
}
TheViewModel vm = new TheViewModel(){ Projects = projects };
//return the view model (contains a Projects property)
return vm;
}
So the only time I can get the Popup custom form to work is to have a parameterless Index method:
public
ViewResult Index()
{
//Get me all the projects
}
This won't work for us because we have a navigation bar on the left by which users navigate ProjectGroups and perform on the operations for the Projects for the ProjectGroup's. When the Edit button is clicked, the Grid control seems to pass the parameter of the selected Project (the datakey) into the URL along with some other stuff and this is where things break. A window tries to pop-up, but it actually doesn't contain anything so all you see is the "X" in the upper right of the modal to close it. I appreciate any advice anyone can offer. btw, here is how I'm creating my Grid:
@(Html.Telerik().Grid<
TantaComm.DartVue.Services.ViewModels.ProjectViewModel
>(Model.Projects)
.Name("Projects")
.DataKeys(keys => keys.Add(c => c.ProjectID))
.DataBinding(databind => databind.Server().Update("Edit", "ProjectGroups"))
.Columns(columns =>
{
columns.Bound(c => c.Name);
columns.Bound(c => c.Code);
columns.Bound(c => c.StartDate).Format("{0:d}");
columns.Bound(c => c.IsActive);
columns.Add(c => c.ProjectGroups.Count).Title("Groups");
columns.Command(cmd => cmd.Edit().ButtonType(GridButtonType.Text));
}).Editable(editing => editing.Mode(GridEditMode.PopUp))
.Pageable()
.Sortable())