dcsimg
Results 1 to 7 of 7

Thread: Grids, Flex Grids, Datagrids (Help)

  1. #1

    Thread Starter
    Lively Member n00b1337's Avatar
    Join Date
    Sep 2003
    Location
    Berlin Connecticut
    Posts
    67

    Grids, Flex Grids, Datagrids (Help)

    OK i wanan be able to :
    1. Name the Different Columns (8 of them)
    2. Directly Edit data in the Fields
    3. When user Clicks the First Column i want it to Select the Whole Row going across

    Bare with me im am 100% noob when it comes to Database , i duno what to use to do this or even how to start Please give me some starting code
    [VBcode]
    SubLife_Load()
    If Age>25
    Unload me
    end if
    sub end

    [/vbcode]

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,701
    I have only worked with non-bound FlexGrids, so I may not have that much info. By naming the columns I assume you want to make it look something like an Excel name. To do this you would put your column names in the first row, and make it a fixed row. That would keep it visible and uneditable, which would have the effect you desire.

    Editing data in a FlexGrid is impossible.

    Fortunately, editing data in a textbox is possible. The way you can get a flexgrid to appear to be editable is that when a cell in the grid gains focus, you move a textbox (have one hidden out of the way to begin with, and it can't have borders) to the cells size and position (the top, bottom, width and length must be the same), then put the data from the grid into the textbox. The user will see the data as if it were in the grid cell, and will be able to alter it as if it were in the grid cell, but it really isn't. Once the user moves elsewhere, the data from the textbox must be written to the record underlying that row of data.

    To make it look seamless, the font and positioning in the textbox has to be the same as the underlying cell, but that should be easy enough.

    I forget how to select a column, but it is really easy.

  3. #3
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174
    It's not entirely impossible to 'directly' edit data in a flexgrid. In essence, upon typing, you can capture the keyascii and input them to the currently highlighted cells.

    When user Clicks the First Column i want it to Select the Whole Row going across
    I'm not sure I understand this.

  4. #4
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    For MSFlexGrid

    The SelectionMode property let's you select by cell, row, or column.

    flexSelectionFree 0 Free. Allows selections to be made normally, spreadsheet-style.
    flexSelectionByRow 1 By Row. Forces selections to span entire rows, as in a multi-column list-box or record-based display.
    flexSelectionByColumn 2 By Column. Forces selections to span entire columns, as if selecting ranges for a chart or fields for sorting.
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,701
    Mendhak (nice new avatar, by the way. That's a better likeness of you ), I hadn't thought of that method. It looks pretty cool, though it seems like it might be a little painful at times. Would you just update all the records at the end? or update the field from the edited record when the box loses focus?

  6. #6
    Addicted Member Abilio's Avatar
    Join Date
    May 2003
    Location
    Aveiro - Portugal
    Posts
    222
    And, of course you can use API to create a cursor and have real input in MsFlexGrid. You will also need to hook keyboard from MsFlexGrid. This way, you can use arrows to move up or down in the grid, without lose a blinking cursor over the active cell. So, don't say that it is not possible, only because you can't do it !

  7. #7
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174
    Originally posted by Shaggy Hiker
    Mendhak (nice new avatar, by the way. That's a better likeness of you ), I hadn't thought of that method. It looks pretty cool, though it seems like it might be a little painful at times. Would you just update all the records at the end? or update the field from the edited record when the box loses focus?
    Thx.

    I usually do go by the invisible textbox over the flexgrid method. However, I used to go by the keycapture event. I'll do a search and post this method. If I find it.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width