Results 1 to 9 of 9

Thread: [RESOLVED] MSFLEXGRID - how to get column number of 1st displayed column?

Hybrid View

  1. #1
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: MSFLEXGRID - how to get column number of 1st displayed column?

    There is no property for the last row/column, you need to calculate it somehow.

    The two main ways are:
    • loop from .TopRow to .Rows-1 checking .RowIsVisible() to see when it becomes False - but be careful of rows that are partly visible, as the way RowIsVisible treats it may not be what you expect.
    • write your own code to do the equivalent of .RowIsVisible, based on .RowPos and .RowHeight for each of the rows. This takes more work, but you can determine when a row is partly visible, and treat it as you want.



    You can't set a property to hide the scrollbar without disabling scrolling, but what you can do is put the grid inside a picturebox, and set the width of the picturebox to the width of the grid minus the width of the scrollbar.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Location
    Kerala, India
    Posts
    275

    Re: MSFLEXGRID - how to get column number of 1st displayed column?

    Thanks Optional & Si_the_Geek for the advice.

    Actually my problem is this:

    I want to make the cells editable as in Spreadsheet applications like Excel etc. For this I am diplaying a textbox at the exact position of the selected cell. This creates problems when scrolling if the selected cell goes out of the display.

    I have made some modifications based on your suggestions and now it seems to work ok.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width