[2.1] GridPanelFor RowNumbererColumn

  1. #1

    [2.1] GridPanelFor RowNumbererColumn

    Hi,

    how can I add the RowNumbererColumn column to the GridPanelFor, since the columnmodel is automatically generated?

    If I write
    .AddColumn(Html.X().RowNumbererColumn())
    it doesn't work and thorws a js exception (an unreadable exception in a dynamic axd file, relating to an array out of index)..

    Any idea?

    Thanks.
  2. #2
    AddColumn is method which generates script for already rendered grid
    Try this
    Html.X().GridPanelFor(Model)
        .ColumnModel(Html.X().RowNumbererColumn())
    It will add the column to the end, if need to insert that column as first then try this
    .ColumnModel(cm =>{
                        cm.Columns.Insert(0, new RowNumbererColumn());
                    })
  3. #3
    Fantastic!

    Used the second solution. It works perfectly.

    Can be marked as closed.

    Thanks.

Similar Threads

  1. [2.1] GridPanelFor Batch Update
    By millenovanta in forum 2.x Help
    Replies: 20
    Last Post: Dec 26, 2012, 12:27 PM
  2. SyncParameters in GridPanelFor
    By millenovanta in forum 2.x Help
    Replies: 0
    Last Post: Dec 05, 2012, 8:04 PM
  3. [2.1] GridPanelFor Editor field related to model
    By millenovanta in forum 2.x Help
    Replies: 2
    Last Post: Nov 30, 2012, 3:34 PM
  4. [CLOSED] [1.0] RowNumbererColumn
    By state in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 05, 2010, 8:19 PM
  5. [ADDED] [v0.7.0] RowNumbererColumn
    By Rod in forum 1.x Help
    Replies: 2
    Last Post: Oct 04, 2008, 1:05 PM

Posting Permissions