Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
Creating empty column without model-relation with mvc
posted

Using MVC (Razor), how can I get in igGrid a empty column like:

{ headerText: "", key: "Delete", dataType: "string", width: "20%", unbound: true, template: "" }

Code from: http://www.igniteui.com/grid/column-template
 
 
What I need is something like this:

.Columns(column => {
column.For(x => x.ModelX1.First().ID).HeaderText("Meeting ID"));
column.For(" ... ")......);

column(" ... ")......);

});

Parents
  • 17590
    Verified Answer
    Offline posted

    Hello Stanislas,

    Thank you for posting in our community.

    What I can suggest for adding an unbound column in igGrid is adding it in the columns collection as following:

    .Columns(col =>
    {
        col.For(c => c.ProductID).HeaderText("ProductID");
        .

       .
        col.Unbound("Delete").HeaderText("Delete").DataType("string").Template("<input type='button' value='Delete row' onclick='deleteRow(${ProductID})' class='delete-button'/>");
    })

    I believe you will find the following articles in our documentation useful:

    Populating Unbound Columns Remotely

    Populating Unbound Columns Locally

    If you have any additional questions after having a look at my code snippets and the provided articles please feel free to contact me.

Reply Children