Scrolling the contents in a data grid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shaam
    New Member
    • Aug 2006
    • 11

    Scrolling the contents in a data grid

    the contents in the datagrid should be scrolled, with the header freezed...
    that means when ever the web page is opened the contents should scroll automatically,e xcept the header
    plzz help
  • rupalirane07
    New Member
    • Aug 2007
    • 9

    #2
    <style type="text/css">.DataGridF ixedHeader { BACKGROUND: none transparent scroll repeat 0% 0%; POSITION: relative; ; TOP: expression(this .offsetParent.s crollTop) }
    </style>

    Add the Above Line in HTML page of ur form after the following line:

    <meta content="http://schemas.microso ft.com/intellisense/ie5" name="vs_target Schema">

    after this come to Design view and click on Datagrid and go to properties and then HeaderStyle tag-type name of CssClass-DataGridFixedHe ader

    and now run the page this ll be much helpful

    Comment

    • dip_developer
      Recognized Expert Contributor
      • Aug 2006
      • 648

      #3
      Originally posted by rupalirane07
      <style type="text/css">.DataGridF ixedHeader { BACKGROUND: none transparent scroll repeat 0% 0%; POSITION: relative; ; TOP: expression(this .offsetParent.s crollTop) }
      </style>

      Add the Above Line in HTML page of ur form after the following line:

      <meta content="http://schemas.microso ft.com/intellisense/ie5" name="vs_target Schema">

      after this come to Design view and click on Datagrid and go to properties and then HeaderStyle tag-type name of CssClass-DataGridFixedHe ader

      and now run the page this ll be much helpful
      rupali's code...
      TOP: expression(this .offsetParent.s crollTop)
      is more or less good for fixed datagrid header.......
      the only problem with this I have seen is whenever there is DropDownList control in the datagrid the Dropdown comes over the header....just check that.......

      Comment

      • rupalirane07
        New Member
        • Aug 2007
        • 9

        #4
        if that is the problem then do this:

        if u r using dropdownlist then u must be using Template Column.
        then right clik on Datagrid -Edit Template -go to column[n] n means watever column comes in my case it is column[4] then clik on itemtemplate dropdownlist-properties-css field is there then give the name DataGridFixedHe ader and then end Template editing. and run and check.

        Try this it wont comes over the header
        Originally posted by dip_developer
        rupali's code...
        TOP: expression(this .offsetParent.s crollTop)
        is more or less good for fixed datagrid header.......
        the only problem with this I have seen is whenever there is DropDownList control in the datagrid the Dropdown comes over the header....just check that.......

        Comment

        • dip_developer
          Recognized Expert Contributor
          • Aug 2006
          • 648

          #5
          Originally posted by rupalirane07
          if that is the problem then do this:

          if u r using dropdownlist then u must be using Template Column.
          then right clik on Datagrid -Edit Template -go to column[n] n means watever column comes in my case it is column[4] then clik on itemtemplate dropdownlist-properties-css field is there then give the name DataGridFixedHe ader and then end Template editing. and run and check.

          Try this it wont comes over the header
          Thanks Rupali......its fascinating to learn something new........I will try it.....thanks for your suggestion..... ..

          Comment

          Working...