Results 1 to 24 of 24

Thread: Please help me about datagrid

  1. #1

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Please help me about datagrid

    Someone please help me!
    How to make checkbox in a vb6 datagrid column?

    Thank you in advance
    Last edited by Vincent Hadison; May 20th, 2013 at 11:35 PM.

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Please help me about datagrid


  3. #3

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    Thanks Guy I will try it later

  4. #4

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    I test it, but it failed, if I may know what datagrid did he/she use?

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Please help me about datagrid

    'failed'? How so....what's the error, and where did it 'fail' (what line of code).....

  6. #6

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    Sorry, i have been late to answer u
    From these codes:
    .col = .cols - 1
    .CellFontName = "Wingdings 2"
    .CellFontSize = 16
    .CellFontBold = True
    .CellForeColor = QBColor(12)
    I got:
    "Compile Error:

    Method or data member not found"
    Tq 4 ur help

  7. #7

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    P.S. I use 'Microsoft DataGrid Control 6.0 (OLEDB)
    Ty

  8. #8
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Please help me about datagrid

    AFAIK, you can use checkboxes on a plain datagrid. The control used in the link is probably an MSHFlexgrid or MSFlexGrid.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  9. #9

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    How? Can u give me the code?
    Thanks

  10. #10
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Please help me about datagrid

    What is the NAME of your datagrid?...the example in that link uses "Grid1".

  11. #11

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    Sorry for my late to answer you, ya my datagrid name is GRIDX
    Thx for your help

  12. #12
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Please help me about datagrid

    Did you get it to work?

  13. #13

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    Get what?

  14. #14

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    Master Sam, I have already change the "grid1" to "GRIDX" but it also didn't work
    Can u give me another code or somethin else?
    Thanks for your help,

    VH

  15. #15

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    Quote Originally Posted by Vincent Hadison View Post
    Sorry, i have been late to answer u
    From these codes:
    .col = .cols - 1
    .CellFontName = "Wingdings 2"
    .CellFontSize = 16
    .CellFontBold = True
    .CellForeColor = QBColor(12)
    I got:
    "Compile Error:

    Method or data member not found"
    Tq 4 ur help
    and from these I got range on the word ".cols"
    Thanks Master, sorry for disturbing you for a long time,

    VH

  16. #16
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Please help me about datagrid

    Maybe I can assist if you tell me what you mean by 'it also didn't work'. What error did you receive? Post YOUR code and show where the error occurred.

    EDIT: Oops, JUST saw your code. That error message means what it says. SOUNDS like your grid name is incorrect. Can you post a bit more of your code showing what your dot col, dot CellFontName, etc apply to?

  17. #17

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    Private Sub GRIDX_KeyPress(KeyAscii As Integer)
    Dim A As Integer
    dim R1 as integer

    R1 = GRIDX.Row

    If R1 > 0 And (KeyAscii = 13) Then

    With GRIDX
    .Col = .cols - 1
    .CellFontName = "Wingdings 2"
    .CellFontSize = 16
    .CellFontBold = True
    .CellForeColor = QBColor(12)
    End With


    If GRIDX.TextMatrix(R1, 4) = "P" Then
    GRIDX.TextMatrix(R1, 4) = ""
    Else
    GRIDX.TextMatrix(R1, 4) = "P"
    End If
    End If
    Webbrowser1.Navigate = Winsock1
    End Sub

  18. #18

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    And the error I got:
    Quote Originally Posted by Vincent Hadison View Post
    Private Sub GRIDX_KeyPress(KeyAscii As Integer)
    Dim A As Integer
    dim R1 as integer

    R1 = GRIDX.Row

    If R1 > 0 And (KeyAscii = 13) Then

    With GRIDX
    .Col = .cols - 1
    .CellFontName = "Wingdings 2"
    .CellFontSize = 16
    .CellFontBold = True
    .CellForeColor = QBColor(12)
    End With


    If GRIDX.TextMatrix(R1, 4) = "P" Then
    GRIDX.TextMatrix(R1, 4) = ""
    Else
    GRIDX.TextMatrix(R1, 4) = "P"
    End If
    End If
    Webbrowser1.Navigate = Winsock1
    End Sub

  19. #19

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    The error message is
    "Compile Error:

    Method or data member not found"
    Sorry for disturbing and wasting ur time

  20. #20
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Please help me about datagrid

    I see this is a COMPILE error; I am assuming you do not get any errors when RUNNING the program, correct? In your posted code (#18), you DO have one exraa "End If" in there, but that won't cause this type of Compile Error. And, I don't see what Winsock equals.
    Have you tried running ALL your code before compiling it? Do you get any errors in any of your code.
    SOMEWHERE in your code, you are referencing an object that doesn't exist....usually a misspelling, but sometimes it refers to your database call.

  21. #21
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Please help me about datagrid

    Has anyone considered post #8?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  22. #22
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Please help me about datagrid

    dee-u
    U R Correct.....code is for MSFlex, not data, grid.
    Vince...look at this link.....http://www.developerfusion.com/threa...th-checkboxes/
    If you can't figure out that one, simply do a Google (or Bing) on "visual basic 6 datagrid checkboxes"

  23. #23

    Thread Starter
    Member
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    33

    Re: Please help me about datagrid

    Thanks 4 all your help Sam & Dee, but, when I scroll the datagrid horizontally, the checkbox do not fix in the column I want.

  24. #24
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Please help me about datagrid

    Would you mind posting posting your code now...the one that works (before scrolling)? Include enough so we can view/replicate/analyze.
    And when you state your issue(s), can you be a bit more descriptive.....What do you mean by "the checkbox do not fix in the column I want." (Do you mean 'fit'?) (Is it because the column is too narrow? Or is it because it is not in the correct column? Hard to understand the real issue.

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