Creating a flexgrid in WebMap 2.0

WebMap 2.0 provides built in support for a simple grid called FlexGrid.

To use it. Follow this steps:

  1. Add a DataGridViewFlexViewModel property to your ViewModel

    public virtual      UpgradeHelpers.BasicViewModels.DataGridViewFlexViewModel grid1{ get; set; }
    
  2. Initialize it on the Build method

    public virtual void Build(UpgradeHelpers.Interfaces.IIocContainer ctx)
    {
        this.grid1 = ctx.Resolve<UpgradeHelpers.BasicViewModels.DataGridViewFlexViewModel>();
     //Rest of code omitted
    }
    
  3. Modify your html:

     <div id="MSFlexGrid1" tabindex="1" data-role="wmflexgrid" data-itemssource="grid1" data-pagesize="9" data-bind="flexGridDefinition : grid1.Columns, flexGridRefresh : grid1.NeedsRefresh"></div>