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

[Solved] AJAX Grid based on relationship

0 Answers 15 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.
Zero
Top achievements
Rank 2
Zero asked on 11 Oct 2012, 06:39 PM
I couldn't quite find an answer to this. I have a model (Entity Framework) that spits back it's table (Call it Projects) and four relational tables (the one we care about is called Milestones). I have an edit page for the Project (singular) and inside it a grid that is the relationship Milestone. I can get the grid to display if I take out some of the binding controls, like this:

@Html.Telerik().Grid(Model.Milestones).Name("MilestonesGrid").DataKeys(x => { x.Add(p => p.Id); }).DataBinding(
binder =>
    /*Some more info needs to go here*/
}).Columns(columns =>
{
    columns.AutoGenerate(true);
    /*Some more info needs to go here*/
}).Editable(edit =>
{
    edit.Mode(GridEditMode.InLine);
    /*Some more info needs to go here*/
}).Pageable().Scrollable().Sortable()
But I want InLine edits without postback. I got about this far with it, but it doesn't seem to take:

@Html.Telerik().Grid(Model.Milestones).Name("MilestonesGrid").DataKeys(x => { x.Add(p => p.Id); }).ToolBar(
commands => commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0" })).DataBinding(
binder =>
{
    binder.Ajax()
        .Select("SelectAJAXMilestones")
        .Insert("InsertAJAXMilestone")
        .Delete("DeleteAJAXMilestone")
        .Update("UpdateAJAXMilestone");
    /*Some more info needs to go here*/
}).Columns(columns =>
{
    columns.AutoGenerate(true);
    /*Some more info needs to go here*/
}).Editable(edit =>
{
    edit.Mode(GridEditMode.InLine);
    /*Some more info needs to go here*/
}).Pageable().Scrollable().Sortable()

Currently errors out saying circular reference, but I'm unsure of what to put into the controller at the moment (I say for it to return itself unchanged just to get it working).

Am I on the right track? Where do I go from here?
Tags
Grid
Asked by
Zero
Top achievements
Rank 2
Share this question
or