Question

I would like to add a column to my iggrid which is used to display current users from my sqlserver db. As is typically done the row would appear as [ 'username' 'email' 'select' ] usinf the select to link to another mvc3 view which displays the users details. I could very easily do this using a table, however, my senior will only allow me to use the Infragistics Jquery IGGrid. And despite my research I'm at a loss. Any help would be greatly appreciated. My current code is the following:

@(Html.Infragistics().Loader()
        .ScriptPath(Url.Content("../../Scripts/Infragistics/js/"))
        .CssPath(Url.Content("../../Content/Infragistics/css/"))
        .Theme("infragistics")
        .Render()
    )

    @(Html.Infragistics().Grid(Model.users)
        //.DataSourceUrl("MCMonthlyAcctTotal")
        .ID("grid").Width("auto").Height("500px")
        .LoadOnDemand(false)
        .AutoGenerateColumns(false)
        .Columns(column =>
        {
            column.For(x => x.FirstName).HeaderText("First Name");
            column.For(x => x.LastName).HeaderText("Last Name");
            column.For(x => x.Email).HeaderText("Email");
            column.For(x => x.Injected).HeaderText("Date Created");
            column.For(x => x.UserName).HeaderText("Username");
            column.For(x => x.Modified).HeaderText("Last Date Modified");
        })

        .Features(features =>
        {
            features.Paging().Type(OpType.Local).VisiblePageCount(5).ShowPageSizeDropDown(true).PageSize(10).PrevPageLabelText("Previous").NextPageLabelText("Next");
            features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings =>
            {
                settings.ColumnSetting().ColumnKey("CustomerID").AllowSorting(true);
            });
            features.Selection().MouseDragSelect(true).MultipleSelection(false).Mode(SelectionMode.Row);
        })
         .Width("auto")
         .DataBind()
         .Render()
    )

I hope someone will be able to give me a hand.

Thanks!!

Was it helpful?

Solution

Sounds like you are trying to do a "master-detail" scenario where one grid displays the Users and the other displays the UserDetails of the currently selected user. Is this correct? If this is so, I believe I have the solution for you in my SkyDrive account at http://skydrive.live.com/redir?resid=E4CF03E23FE33AFE!129

Hope it works out for you!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top