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
627
Header locking and column reformatting
posted

Hi,

I have 2 question according to Webgrid:

  1. How can I lock the headers (like in Excel) so I'll be able to see the columns' headers while scrolling down the grid? (I found how to lock columns but not how to lock the headers)
  2. Can I reformat a column?  I have a column with values like 14.123654646 and I wanna see only 2 digits after the decimal point.

Thanks

Maya

  • 508
    posted

    Hi Maya,

    I wanted to know how did you lock the columns? I have a huge webgrid with large horizontal scroll and

    the first column is a date column. Requirement is to freeze or lock the date column so that even if we

    scroll horizontally, we can track the date of the row.

    Thanks in advance.

     

    Sairam

  • 485
    posted

     Hope this would help -

    1. mobjCServerGrid.DisplayLayout.UseFixedHeaders = true;

    mobjCServerGrid.DisplayLayout.StationaryMargins = StationaryMargins.Header;

    2.

    By Setting Column format properties.

    mobjCServerGrid.Columns[0].format = "0.00";