Bind Datatables to @grid.GetHtml table

Bind Datatables to @grid.GetHtml table

croixtechcroixtech Posts: 2Questions: 1Answers: 0

Hi Guys, in my CSHTML I have created a

@grid.GetHtml(
fillEmptyRows: false,
tableStyle: "webgrid-table",
headerStyle: "webgrid-header",
footerStyle: "webgrid-footer",
alternatingRowStyle: "webgrid-alternating-row",
rowStyle: "webgrid-row-style",

mode: WebGridPagerModes.All,

)

Can you guide me to apply datatables style ?

Regards

Answers

  • croixtechcroixtech Posts: 2Questions: 1Answers: 0

    Hi!

    I have solved this by applying an ID to the webgrid like this:

    @grid.GetHtml(
    htmlAttributes: new { id = "table-id" },
    fillEmptyRows: false,

    The thing is that I would like to use the webgrid paging, and it's drawn at tfoot, but for some reasong datatable.js is hiding it, and if I change the horizontal resolution it appears.

    Do you know how to fix it ?

This discussion has been closed.