0

I am new to mvc webgrid control. The problem is ,am able to bind the grid with data, what i need is to freeze the first two column of the grid .I tried to use jquery plugin , but it's not working. Please help me out. TIA

@grid.GetHtml(tableStyle: "background-HeadeColor", mode: WebGridPagerModes.All,
 htmlAttributes: new { id = my grid},
      columns: grid.Columns(grid.Column(@Resources.FDAccReg.gvSelect,
      format: @<text><input type="checkbox" name="ids" value="@item.intSubAccId"/></text>),
        grid.Column(@Resources.Reg.SrNo, format: item => (item.WebGrid.Rows.IndexOf(item) + 1)),
        grid.Column(@Resources.Reg.Branch, format: item => item.Name),
        grid.Column(@Resources.Reg.AccNo, format: item => item.comst),
        grid.Column(@Resources.Reg.Name, format: item => item.Scheme),
        grid.Column(@Resources.Reg.No, format: item => item.intMemberId),
        grid.Column(@Resources.Reg.Holder, format: item => item.member),
        grid.Column("Matured", format: item => item.Acc))) 
      </div>
  • What do you mean _freeze the first two column of the grid_? –  Mar 17 '18 at 06:20
  • It means when i scroll horizontally the first 2 columns must be at same position(fixed position) – Vinay Diddi Mar 17 '18 at 06:22
  • AFAIK, WebGrid does not support that, but you could use css to style it - refer [this Q/A](https://stackoverflow.com/questions/1312236/how-do-i-create-an-html-table-with-fixed-frozen-left-column-and-scrollable-body) for an example –  Mar 17 '18 at 06:31

0 Answers0