Results 1 to 7 of 7

Thread: [RESOLVED] MSFlexGrid.AddItem

  1. #1

    Thread Starter
    Member varunj's Avatar
    Join Date
    Jun 2006
    Location
    Mumbai, India
    Posts
    57

    Resolved [RESOLVED] MSFlexGrid.AddItem

    Hi all

    I am working on msflexgrid, now i am stuck in one place, actually I want add row in flexgrid at run time...

    I am using this syntex:

    VB Code:
    1. msFlxPane.AddItem "1" & vbTab & var_awb, msFlxPane.RowSel

    now the problem is this, this statement add row but at begining of flexgrid, while I want add row at the last, is there any way to sort this problem

    thanks in advance.

    Regards
    VJ
    VJ
    1000 MILES OF JOURNEY, BEGINS WITH A SINGLE FOOT STEP......

  2. #2
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: MSFlexGrid.AddItem

    you can do something like this

    VB Code:
    1. msFlex.Rows = msFlex.Rows + 1
    2. msFlex.TextMatrix(msFlex.Rows - 1, 0) = "First Collumn Value"
    3. msFlex.TextMatrix(msFlex.Rows - 1, 1) = "Second Collumn Value"
    4. msFlex.TextMatrix(msFlex.Rows - 1, 2) = "Third Collumn Value"
    5. 'and so on and so forth
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  3. #3

    Thread Starter
    Member varunj's Avatar
    Join Date
    Jun 2006
    Location
    Mumbai, India
    Posts
    57

    Lightbulb Re: MSFlexGrid.AddItem

    Hi

    thanks for your quick reply, but I did one thing, now I am sorting records after clicking on the grid

    the code:


    VB Code:
    1. Private Sub msFlxPane_Click()
    2. msFlxPane.Sort = 1
    3. End Sub

    this code is in one function which I call in another process:
    VB Code:
    1. msFlxPane.AddItem sno & vbTab & var_awb, msFlxPane.RowSel
    2. Call msFlxPane_Click

    every time sno(serial number will increase) and it will sort,

    but still one problem is: in the top after fixed row it left one blank row..
    I couldn't find why is this happening.

    thanks in advance
    Regards
    VJ
    VJ
    1000 MILES OF JOURNEY, BEGINS WITH A SINGLE FOOT STEP......

  4. #4
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: MSFlexGrid.AddItem

    you need to ensure you don't have any blank non-fixed rows in your grid before you start adding.

  5. #5

    Thread Starter
    Member varunj's Avatar
    Join Date
    Jun 2006
    Location
    Mumbai, India
    Posts
    57

    Lightbulb Re: MSFlexGrid.AddItem

    Hi bush

    Yes I did that,

    actually first I mention

    VB Code:
    1. msflexgrid.cols=8
    2. msflexgrid.rows =2

    when I got this problem, I did rows = 1
    after that it gives run time error bcoz it takes first row for adding new row, and error says can not change fixed row..

    now tell me..

    regards
    VJ
    VJ
    1000 MILES OF JOURNEY, BEGINS WITH A SINGLE FOOT STEP......

  6. #6
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: MSFlexGrid.AddItem

    since you're sorting it anyway, you can remove the last argument of the .AddItem method:
    VB Code:
    1. msFlxPane.AddItem sno & vbTab & var_awb
    2. Call msFlxPane_Click

  7. #7

    Thread Starter
    Member varunj's Avatar
    Join Date
    Jun 2006
    Location
    Mumbai, India
    Posts
    57

    Resolved Re: MSFlexGrid.AddItem

    Hi all

    thanks for your valuable suggestions, I just solved the issue
    I did one thing for that blank row I just mention one line

    VB Code:
    1. msFlxPane.RowHeight(1) = 0

    and problem solved

    thanks for all
    Regards
    Varun
    VJ
    1000 MILES OF JOURNEY, BEGINS WITH A SINGLE FOOT STEP......

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