Page 2 of 2 FirstFirst 12
Results 41 to 51 of 51

Thread: MSHFlexgrid, how can I edit the columns? ***RESOLVED***

  1. #41
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by WiseGuy
    Muddy code does work, I'm just trying to find out when to trigger the code :S

    WiseGuy
    Try mine

  2. #42

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Everything works fine now, This is how my code looks like right now:

    VB Code:
    1. Set cn = New ADODB.Connection
    2.   cn.ConnectionString = "Data Source=spijsDB;User ID=spijs;Password=spijs;"
    3.   cn.Open
    4.   Set rs = New ADODB.Recordset
    5.   grdDataGrid.Refresh
    6.   cn.CursorLocation = adUseServer
    7.   strSQL = "select a.artikelID, a.productcode, a.artikelnaam, b.typecode,
    8.            TO_CHAR(a.tolerantiepluskg), c.celnaam, TO_CHAR(a.natdroogverh)
    9.            from artikelen a, artikeltype b, cellen c"
    10.   rs.Open strSQL, cn
    11.   Set grdDataGrid.DataSource = rs
    12.   grdDataGrid.Refresh
    13.   grdDataGrid.TextMatrix(0, 1) = "Nummer"
    14.   grdDataGrid.TextMatrix(0, 2) = "Product Code"
    15.   grdDataGrid.TextMatrix(0, 3) = "Artikel"
    16.   grdDataGrid.TextMatrix(0, 4) = "Artikeltype"
    17.   grdDataGrid.TextMatrix(0, 5) = "Tolerantie (KG)"
    18.   grdDataGrid.TextMatrix(0, 6) = "Celnaam"
    19.   grdDataGrid.TextMatrix(0, 7) = "Nat/Droog verhouding"
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  3. #43
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    Originally posted by mendhak
    I mean
    how can you bind a flexgrid.

    (forget the runtime part)
    Sir Frog,

    When the Datasource property is set, I consider the grid "bound". Of course I could very well have my terminology screwed up.

    I mean, after all, I am just a bluesman impersonating a programmer.

  4. #44
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by Muddy


    Sir Frog,

    When the Datasource property is set, I consider the grid "bound". Of course I could very well have my terminology screwed up.

    I mean, after all, I am just a bluesman impersonating a programmer.
    Bluesman,
    previously you confused me.
    Now you're scaring me! (kidding!)
    OK, I checked, and flexgrids don't have a datasource property. Are we talking about the same flexgrid here? MSFLEXGRID. That's what I have. I have to connect it to the db, and manipulate everything through code.

    How is it that you talk about a datasource property which I know not of?

    (btw, lara stays here! )

  5. #45
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    Originally posted by mendhak


    Bluesman,
    previously you confused me.
    Now you're scaring me! (kidding!)
    OK, I checked, and flexgrids don't have a datasource property. Are we talking about the same flexgrid here? MSFLEXGRID. That's what I have. I have to connect it to the db, and manipulate everything through code.

    How is it that you talk about a datasource property which I know not of?

    (btw, lara stays here! )
    Sir Frog,
    After reading your post and sig I am convinced of 2 things:
    1) you are stoned
    2) i am stupid
    LOL

    My MSFlexGrid has a datasource property. So does WiseGuy's ... check out the code he posted

  6. #46
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by Muddy


    Sir Frog,
    After reading your post and sig I am convinced of 2 things:
    1) you are stoned
    2) i am stupid
    LOL

    My MSFlexGrid has a datasource property. So does WiseGuy's ... check out the code he posted
    Answer: 1. I'm stoned. (just a bit)

    I checked AGAIN... and for some strange reason, it's THERE!!! (conspiracy?????)

    Just one more quick question, if you're still looking at this post...
    the datasource applies for things like ADODC and the normal datacontrol, right?

    Hope you're looking, otherwise, I'll put up a new post after 10 minutes if you don't answer.

  7. #47
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    Originally posted by mendhak
    (btw, lara stays here! )


    Hang on and I'll wake her up and give her the message




    [QUOTE]Originally posted by mendhak
    (Just one more quick question, if you're still looking at this post...
    the datasource applies for things like ADODC and the normal datacontrol, right?


    those or an ADO Recordset ...

  8. #48
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697
    Muddy, the below works fine but it doens't save any changes I make in the MSFlexGrid. How do you save any changes??

    Lintz.


    Originally posted by Muddy
    hmm, this works ... got if off a thread ... dont remeber from who

    but you can edit the msflexgrid ... give it a try

    VB Code:
    1. Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
    2.     With MSFlexGrid1
    3.         Select Case KeyAscii
    4.                
    5.             Case 8: 'IF KEY IS BACKSPACE THEN
    6.                 If .Text <> "" Then .Text = _
    7.                  Left$(.Text, (Len(.Text) - 1))
    8.             Case 13: 'IF KEY IS ENTER THEN
    9.                 Select Case .Col
    10.                     Case Is < (.Cols - 1):
    11.                         SendKeys "{right}"
    12.                     Case (.Cols - 1):
    13.                         If (.Row + 1) = .Rows Then
    14.                             .Rows = .Rows + 1
    15.                         End If
    16.                         SendKeys "{home}" + "{down}"
    17.                 End Select
    18.             Case Else
    19.                 .Text = .Text + Chr$(KeyAscii)
    20.                 'write your own keyascii Validations under
    21.                        'commented lines
    22.                 Select Case .Col
    23.                     Case 0, 1, 2:
    24.                         'if (your condition(s)) then
    25.                             'accept only charectors
    26.                         'Else
    27.                         '   keyascii=0
    28.                         'End If
    29.                     Case Else:
    30.                 End Select
    31.         End Select
    32.     End With
    33.  
    34. End Sub

  9. #49
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    I suppose you would have to write the cells to some sort of file (delimited text, mdb, csv. etc)

  10. #50
    New Member
    Join Date
    May 2003
    Posts
    6
    That's right Muddy

  11. #51
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697
    The back end of my app is run by an Access DB. Once I populate the MSFlexGrid how do I then save any changes to a particular record in my DB??

Page 2 of 2 FirstFirst 12

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