5 Replies Latest reply on Oct 24, 2008 4:08 PM by Newsgroup_User

    Datagrid Scrolling Issue

    rspitler
      I have seen a couple posts around somewhat similar problems but none of those workarounds seem to address my issue. I am hoping that there is a viable solution as i think this should be a pretty straightforward usecase. I am trying to use the datagrid to display a source file. Each row in the grid corresponds to a single line in the source file. Using a datagrid gives me great control over the rendering of each line as well as an easy mechanism for storing high level metainformation about the code constructs represented by that row enabling very dynamic navigation through the codebase. In addition it is easy for me to chunk and paginate through large files. All of these benefits led me to this implementation. The one major issue that I am having is the horizontal scrolling of the grid. I have set up the grid so that it uses two columns, one representing the gutter of the source file and the other representing the text. This requires the second columns to be capable of displaying arbitrarily long lines of text (and wrapping is not a reasonable option). Because the second column is of a arbitrary size i need to enable horizontal scrolling on the datagrid to allow access to the information that could spill off the edge of the screen. I have tried a few approaches to this problem and have found no reasonable solution. If i set the width of the datagrid to be a large size then i get the appropriate horizontal scroll bar but no vertical on(it is pushed off the screen). If i set the maxWidth of the data grid and increase the width of the second column i get strange behavior where the horizontal and vertical scroll show up properly but the horizontal scroll does not really enable navigation - the slider is half the width of the scroll bar and when scrolled all the way to the right it causes the grid to scroll but only a small fraction of the necessary distance.

      I am incredibly frustrated right now. This is a very powerful and flexible solution for my problem and i am thwarted by what seems to be a trivial bug. I am scared i may have to reimplement everything i have done so far if i can not solve this issue.

      Thank you for your time
      Russ
        • 1. Re: Datagrid Scrolling Issue
          Level 7

          "rspitler" <webforumsuser@macromedia.com> wrote in message
          news:gdt1dc$9e1$1@forums.macromedia.com...
          >I have seen a couple posts around somewhat similar problems but none of
          >those
          > workarounds seem to address my issue. I am hoping that there is a viable
          > solution as i think this should be a pretty straightforward usecase. I am
          > trying to use the datagrid to display a source file. Each row in the grid
          > corresponds to a single line in the source file. Using a datagrid gives
          > me
          > great control over the rendering of each line as well as an easy mechanism
          > for
          > storing high level metainformation about the code constructs represented
          > by
          > that row enabling very dynamic navigation through the codebase. In
          > addition it
          > is easy for me to chunk and paginate through large files. All of these
          > benefits led me to this implementation. The one major issue that I am
          > having
          > is the horizontal scrolling of the grid. I have set up the grid so that it
          > uses
          > two columns, one representing the gutter of the source file and the other
          > representing the text. This requires the second columns to be capable of
          > displaying arbitrarily long lines of text (and wrapping is not a
          > reasonable
          > option). Because the second column is of a arbitrary size i need to
          > enable
          > horizontal scrolling on the datagrid to allow access to the information
          > that
          > could spill off the edge of the screen. I have tried a few approaches to
          > this
          > problem and have found no reasonable solution. If i set the width of the
          > datagrid to be a large size then i get the appropriate horizontal scroll
          > bar
          > but no vertical on(it is pushed off the screen). If i set the maxWidth of
          > the
          > data grid and increase the width of the second column i get strange
          > behavior
          > where the horizontal and vertical scroll show up properly but the
          > horizontal
          > scroll does not really enable navigation - the slider is half the width of
          > the
          > scroll bar and when scrolled all the way to the right it causes the grid
          > to
          > scroll but only a small fraction of the necessary distance.
          >

          Something went drastically wrong with your formatting. All the paragraph
          breaks were lost, and I find this impossible to parse. Care to try again
          and add extra space so your paragraphs are respected?


          • 2. Re: Datagrid Scrolling Issue
            rspitler Level 1
            quote:

            Originally posted by: rspitler
            I have seen a couple posts around somewhat similar problems but none of those workarounds seem to address my issue. I am hoping that there is a viable solution as i think this should be a pretty straightforward usecase. I am trying to use the datagrid to display a source file. Each row in the grid corresponds to a single line in the source file. Using a datagrid gives me great control over the rendering of each line as well as an easy mechanism for storing high level metainformation about the code constructs represented by that row enabling very dynamic navigation through the codebase. In addition it is easy for me to chunk and paginate through large files.

            All of these benefits led me to this implementation. The one major issue that I am having is the horizontal scrolling of the grid. I have set up the grid so that it uses two columns, one representing the gutter of the source file and the other representing the text. This requires the second columns to be capable of displaying arbitrarily long lines of text (and wrapping is not a reasonable option).

            Because the second column is of a arbitrary size i need to enable horizontal scrolling on the datagrid to allow access to the information that could spill off the edge of the screen. I have tried a few approaches to this problem and have found no reasonable solution. If i set the width of the datagrid to be a large size then i get the appropriate horizontal scroll bar but no vertical on(it is pushed off the screen). If i set the maxWidth of the data grid and increase the width of the second column i get strange behavior where the horizontal and vertical scroll show up properly but the horizontal scroll does not really enable navigation - the slider is half the width of the scroll bar and when scrolled all the way to the right it causes the grid to scroll but only a small fraction of the necessary distance.

            I am incredibly frustrated right now. This is a very powerful and flexible solution for my problem and i am thwarted by what seems to be a trivial bug. I am scared i may have to reimplement everything i have done so far if i can not solve this issue.

            Thank you for your time
            Russ



            • 3. Re: Datagrid Scrolling Issue
              Level 7

              "rspitler" <webforumsuser@macromedia.com> wrote in message
              news:gdtglu$t4e$1@forums.macromedia.com...
              >
              quote:

              Originally posted by: rspitler
              > I have seen a couple posts around somewhat similar problems but none of
              > those
              > workarounds seem to address my issue. I am hoping that there is a viable
              > solution as i think this should be a pretty straightforward usecase. I am
              > trying to use the datagrid to display a source file. Each row in the grid
              > corresponds to a single line in the source file. Using a datagrid gives
              > me
              > great control over the rendering of each line as well as an easy mechanism
              > for
              > storing high level metainformation about the code constructs represented
              > by
              > that row enabling very dynamic navigation through the codebase. In
              > addition it
              > is easy for me to chunk and paginate through large files.
              >
              > All of these benefits led me to this implementation. The one major issue
              > that
              > I am having is the horizontal scrolling of the grid. I have set up the
              > grid so
              > that it uses two columns, one representing the gutter of the source file
              > and
              > the other representing the text. This requires the second columns to be
              > capable of displaying arbitrarily long lines of text (and wrapping is not
              > a
              > reasonable option).
              >
              > Because the second column is of a arbitrary size i need to enable
              > horizontal
              > scrolling on the datagrid to allow access to the information that could
              > spill
              > off the edge of the screen. I have tried a few approaches to this problem
              > and
              > have found no reasonable solution. If i set the width of the datagrid to
              > be a
              > large size then i get the appropriate horizontal scroll bar but no
              > vertical
              > on(it is pushed off the screen). If i set the maxWidth of the data grid
              > and
              > increase the width of the second column i get strange behavior where the
              > horizontal and vertical scroll show up properly but the horizontal scroll
              > does
              > not really enable navigation - the slider is half the width of the scroll
              > bar
              > and when scrolled all the way to the right it causes the grid to scroll
              > but
              > only a small fraction of the necessary distance.
              >
              > I am incredibly frustrated right now. This is a very powerful and
              > flexible
              > solution for my problem and i am thwarted by what seems to be a trivial
              > bug. I
              > am scared i may have to reimplement everything i have done so far if i can
              > not
              > solve this issue.
              >
              > Thank you for your time

              I'd maybe go with something a little more user friendly, such as using
              variableRowHeight so it can wrap, truncating and showing a button that can
              pop up a TitleWindow with the full text inside, or having a text field
              somewhere that is bound to that field in the selectedItem. You could also
              go with a fixed row height, but scrolling within a relatively tall TextArea
              or something within it.

              I hate really wide scrolling windows myself.

              Hope this helps;

              Amy


              • 4. Re: Datagrid Scrolling Issue
                rspitler Level 1
                Those are both really good suggestions, but the one usecase that they dont quite address is the situation where the flow of the source code causes the entire section of code to be offset by a margin that would place it out of the viewable area. For a single line overruning or a few it makes sense to wrap or collapse them, but when there are a number of lines in a row that are significantly offset then having the user select and viwe the content in another viewer for each line becomes a pretty tall order. Though maybe if i toggle the line wrap that might help. The real issue is developers are picky on how they view there source code ...
                • 5. Re: Datagrid Scrolling Issue
                  Level 7

                  "rspitler" <webforumsuser@macromedia.com> wrote in message
                  news:gdtjm5$3jb$1@forums.macromedia.com...
                  > Those are both really good suggestions, but the one usecase that they dont
                  > quite address is the situation where the flow of the source code causes
                  > the
                  > entire section of code to be offset by a margin that would place it out of
                  > the
                  > viewable area. For a single line overruning or a few it makes sense to
                  > wrap or
                  > collapse them, but when there are a number of lines in a row that are
                  > significantly offset then having the user select and viwe the content in
                  > another viewer for each line becomes a pretty tall order. Though maybe if
                  > i
                  > toggle the line wrap that might help. The real issue is developers are
                  > picky
                  > on how they view there source code ...

                  I seem to recall that your issue may be fixable by setting minHeight and/or
                  minWidth to 0.

                  Worth a try, anyway.

                  HTH;

                  Amy