Page 17 of 17 FirstFirst ... 714151617
Results 641 to 655 of 655

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #641

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,876

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by softv View Post
    Dear krool,

    This is in continuation of my last message (in which I have requested your clarification on .colsvisible and .rowsvisible).

    And, reg. the various ComboList values, I am sorry that I am not that very clear in my understanding of them.

    So, via the following cases, I am trying to understand them in the right way from you. So, kindly please help.


    Case 1)
    In your VBFlexGrid demo, in UserEditingForm, I have the following lines at the end of the Form_Load event.

    Code:
    Debug.Print VBFlexGrid1.ComboListCount
    Debug.Print VBFlexGrid1.ComboListIndex
    Debug.Print VBFlexGrid1.ComboList(10) & "Z"
    Debug.Print VBFlexGrid1.ColComboItems(10)
    The above print '0', '0', 'Z' and 'Arnold|Bob|Charlie|David|Elena|Felix|Greg|Hanna|Ivan|Jacob'

    a) Why '0' got printed for .ComboListCount? Why .ComboList(10) prints empty string?
    b) Even if I make the rows count as 2 for VBFlexGrid1 and select 'Ivan' (instead of the default Arnold) in both the 10th and 11th columns, then also .ComboListIndex is printed as '0' only. Why?
    c) Perhaps .ComboList, .ComboListCount and .ComboListIndex carry meaning only when they are used in specific events like VBFlexGrid1_EnterEdit(), VBFlexGrid1_LeaveEdit(), etc.? If so, in which all events they carry meaning? Please let me know.


    Case 2)
    At the end of the VBFlexGrid1_EnterEdit() event, I have the following lines.
    Code:
    Debug.Print VBFlexGrid1.ComboListCount
    Debug.Print VBFlexGrid1.ComboListIndex
    '''''Debug.Print VBFlexGrid1.ComboList(10) & "Z"
    Debug.Print VBFlexGrid1.ColComboItems(10)
    And, when I double click a cell in the 10th column where 'Charlie' is present, what get printed are:
    '10', '2' and 'Arnold|Bob|Charlie|David|Elena|Felix|Greg|Hanna|Ivan|Jacob'

    I had to comment out the 3rd line above because it caused a run time error (Invalid procedure call or argument).

    a) Why the 3rd line caused an error? Please educate me. Is it that it cannot or should not be used in certain events?
    b) Where then should (or where all I can) use that line so that it will show some output?
    c) What actually is .ComboList(10) supposed to show? Is it supposed to show the same output of ColComboItems(10) but without the '|' and all the 10 names displayed one after the other, in 10 lines?


    Case 3)
    At the end of the VBFlexGrid1_LeaveEdit() event, I have the following lines.
    Code:
    Debug.Print VBFlexGrid1.ComboListCount
    Debug.Print VBFlexGrid1.ComboListIndex
    'Debug.Print VBFlexGrid1.ComboList(10) & "A"
    Debug.Print VBFlexGrid1.ColComboItems(10)
    VBFlexGrid1.ComboListIndex = 9
    Debug.Print "yes"; VBFlexGrid1.ComboListIndex
    And, when I double click a cell in the 10th column where Charlie is present and select Charlie itself again, what get printed are:
    '10', '2', 'Arnold|Bob|Charlie|David|Elena|Felix|Greg|Hanna|Ivan|Jacob' and 'yes 9'

    a) I had to keep the 3rd line commented out here also since it caused the same run time error (Invalid procedure call or argument).
    b) Though I changed the .ComboListIndex to 9, the selection remained at 'Charlie' only.
    c) So, where and how should I use .ComboListIndex so that I can "programmatically" change/select the ComboList item in any cell in the 10th column (ComboDropDown) without having to manually double click a cell and select a particular item in the list.


    Thanks a TON once again for your contribution to the world society.

    Kind regards.
    ColComboItems is similar to the ComboItems property, except it applies to entire columns. This is often more convenient that using the ComboItems property because you may set the ColComboItems property once for each column, whereas the ComboItems property normally needs to be set in the BeforeEdit event.

    ComboListCount, ComboListIndex and ComboList(x) are properties to extract info from a once defined ColComboItems/ComboItems.

    So, ComboList(x) is to extract x entry for the current column. X is not the column, that's why you had an error.

  2. #642
    Lively Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    80

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Dear krool,

    As in the case of 'sort', is it possible to show a chevron (inside a square preferably) by the side of the cells of the column whose .ColComboMode is set to FlexComboModeDropDown (or) FlexComboModeEditable? Because, this way, a user will readily know that there is a ComboList existing in the cells of that column.

    If the above is not possible, then what is the easiest way to indicate to the user by text that there is a ComboList existing in those cells? Anyway, since indication via picture is the best way, what is the easiest way to make a chevron get displayed by the side of all such ComboList cells? Draw a picture using ".Cell(FlexCellPicture)"? If so, what would be the best way to draw the chevron pictures so that they appear correctly in all resolutions, etc.? And, will it be possible to act upon click events on those chevron pictures? If not, capturing mouse click events on X,Y coordinates of those chevrons is the only way? Well, any suggestions are welcome. Thanks in advance.

    Kind regards.

  3. #643
    Lively Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    80

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    ColComboItems is similar to the ComboItems property, except it applies to entire columns. This is often more convenient that using the ComboItems property because you may set the ColComboItems property once for each column, whereas the ComboItems property normally needs to be set in the BeforeEdit event.

    ComboListCount, ComboListIndex and ComboList(x) are properties to extract info from a once defined ColComboItems/ComboItems.

    So, ComboList(x) is to extract x entry for the current column. X is not the column, that's why you had an error.
    ComboList(x). Thanks a lot, krool. Understood. I think I have understood difference between ColComboItems and ComboItems too. If there are doubts, I shall write again.

    As of now, can you kindly let me know whether it is possible to programmatically change/select the ComboList item in any cell of a column whose ColComboMode is set to FlexComboModeDropDown (or FlexComboModeEditable)? If so, can you kindly give me a code sample please?

    Kind regards.
    Last edited by softv; Oct 9th, 2021 at 10:54 AM.

  4. #644

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,876

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by softv View Post
    ComboList(x). Thanks a lot, krool. Understood. I think I have understood difference between ColComboItems and ComboItems too. If there are doubts, I shall write again.

    As of now, can you kindly let me know whether it is possible to programmatically change/select the ComboList item in any cell of a column whose ColComboMode is set to FlexComboModeDropDown (or FlexComboModeEditable)? If so, can you kindly give me a code sample please?

    Kind regards.
    Use ComboListIndex to change the selected list item.

  5. #645
    Lively Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    80

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Use ComboListIndex to change the selected list item.
    I had already tried it but did not succeed. But, after seeing your instruction, I tried again and achieved it. Thanks a TON.

    However, I request you to tell me whether there is a better way to achieve it than the way I have adopted below. The code I used (in a button click) was:
    Code:
      With VBFlexGrid1
        .Row = 2
        .Col = 10
        .StartEdit
        .ComboListIndex = 5
        '''''.CommitEdit
      End With
      SendKeys vbLf
    The above worked like a charm, to programmatically select a list item. Thanks a TON once again.
    But, I feel there must be a better alternative to 'SendKeys vbLf'.
    That's why I tried VBFlexGrid1.CommitEdit, but it did not change the ComboListIndex to 5. The dropdown just closed. Kindly suggest me an alternative to 'SendKeys vbLf', if any. Thanks in advance.

    Kind regards.

  6. #646

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,876

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by softv View Post
    I had already tried it but did not succeed. But, after seeing your instruction, I tried again and achieved it. Thanks a TON.

    However, I request you to tell me whether there is a better way to achieve it than the way I have adopted below. The code I used (in a button click) was:
    Code:
      With VBFlexGrid1
        .Row = 2
        .Col = 10
        .StartEdit
        .ComboListIndex = 5
        '''''.CommitEdit
      End With
      SendKeys vbLf
    The above worked like a charm, to programmatically select a list item. Thanks a TON once again.
    But, I feel there must be a better alternative to 'SendKeys vbLf'.
    That's why I tried VBFlexGrid1.CommitEdit, but it did not change the ComboListIndex to 5. The dropdown just closed. Kindly suggest me an alternative to 'SendKeys vbLf', if any. Thanks in advance.

    Kind regards.
    The .ComboListIndex = 5 works as it should. What do you want to achieve, to just avoid user selection and commit list entry 5 ?
    The below code will do it without SendKeys vbLf...
    Code:
    VBFlexGrid1.EditText = VBFlexGrid1.ComboList(5)
    VBFlexGrid1.CommitEdit

  7. #647
    Lively Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    80

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    ... .. .
    The below code will do it without SendKeys vbLf...
    Code:
    VBFlexGrid1.EditText = VBFlexGrid1.ComboList(5)
    VBFlexGrid1.CommitEdit
    Perfect, Krool. Thank you so much.

    Kind regards.

  8. #648
    Lively Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    80

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Dear krool,

    is it possible to freeze rows (one or more) from the bottom rows of a grid? If so, what should I do? Thanks.

    As of now, just to freeze the very last row of the grid is enough for me so that when user scrolls up and down, the last row is always visible.

    Kind regards.

  9. #649

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,876

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by softv View Post
    Dear krool,

    is it possible to freeze rows (one or more) from the bottom rows of a grid? If so, what should I do? Thanks.

    As of now, just to freeze the very last row of the grid is enough for me so that when user scrolls up and down, the last row is always visible.

    Kind regards.
    Not possible. Even Excel doesn't allow it.
    What you want actually? Maybe there is an alternative..

  10. #650
    Lively Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    80

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Not possible. Even Excel doesn't allow it.
    What you want actually? Maybe there is an alternative..
    Oh okay, krool. Understood.

    I just wanted to show the number of records (at any point of time in the grid) in the last row of the grid itself.
    Right now, I am using an alternative only. I am showing the records count in a separate control placed below the grid. If there is a better alternative, kindly let me know.

    I just felt that showing the records count (which will be just .rows-1, in my grid's case) inside the grid itself in a frozen last row will be ideal. That's all.

    Kind regards.
    Last edited by softv; Oct 10th, 2021 at 02:25 AM.

  11. #651

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,876

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by softv View Post
    Dear krool,

    As in the case of 'sort', is it possible to show a chevron (inside a square preferably) by the side of the cells of the column whose .ColComboMode is set to FlexComboModeDropDown (or) FlexComboModeEditable? Because, this way, a user will readily know that there is a ComboList existing in the cells of that column.

    If the above is not possible, then what is the easiest way to indicate to the user by text that there is a ComboList existing in those cells? Anyway, since indication via picture is the best way, what is the easiest way to make a chevron get displayed by the side of all such ComboList cells? Draw a picture using ".Cell(FlexCellPicture)"? If so, what would be the best way to draw the chevron pictures so that they appear correctly in all resolutions, etc.? And, will it be possible to act upon click events on those chevron pictures? If not, capturing mouse click events on X,Y coordinates of those chevrons is the only way? Well, any suggestions are welcome. Thanks in advance.

    Kind regards.
    There is no "picture click" event.
    What's the use-case you want to achieve?

  12. #652
    Lively Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    80

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    There is no "picture click" event.
    What's the use-case you want to achieve?
    Dear krool,

    As written earlier, the use-case is for the user to readily know that a drop down list is present in the cells of a particular column. Obviously, I cannot have column names as DropDown Combo, etc. So, there should be some pictorial indication somewhere to the user so that he knows immediately on seeing the grid that there is a drop down available in the cells of a particular column. Any kind of suggestions towards achieving this (in whatever manners possible) is welcome. Thanks in advance.

    Kind regards.

  13. #653

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,876

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Quote Originally Posted by TheLeePiper View Post
    In short, is there a way to land on a cell that has been set as a dropdown combo and have it not drop the list, just shot the text and the button. (We are hoping to use this as a container for editable fields of a variety of different types. Thanks!
    The workaround with .ComboButtonValue to 'FlexComboButtonValueDisabled' is not needed anymore. There is a new event now 'ComboBeforeDropDown'.
    So you can achieve the wanted behavior now easily by following code:

    Code:
    Private Sub VBFlexGrid1_ComboBeforeDropDown(ByVal Reason As FlexComboDropDownReasonConstants, Cancel As Boolean)
    If Reason = FlexComboDropDownReasonInitialize Then Cancel = True
    End Sub

  14. #654

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,876

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by softv View Post
    Dear krool,

    As written earlier, the use-case is for the user to readily know that a drop down list is present in the cells of a particular column. Obviously, I cannot have column names as DropDown Combo, etc. So, there should be some pictorial indication somewhere to the user so that he knows immediately on seeing the grid that there is a drop down available in the cells of a particular column. Any kind of suggestions towards achieving this (in whatever manners possible) is welcome. Thanks in advance.

    Kind regards.
    That's an interesting question. So, a visual cue that a dropdown will appear when attempting to edit.
    The not disturbing approach would be not to always show such a "chevron" but only when that cell is selected. Using the RowColChange event.
    However, using a picture with right align and no overlap would be the easiest and dynamically set/clear upon RowColChange.
    Difficult part is to create such a dynamic scaled picture at run-time. (Using DrawFrameControl etc.)

  15. #655
    Junior Member
    Join Date
    Jan 2017
    Location
    British Columbia
    Posts
    20

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Yes great. Thanks

    You migrate 1.4 OCX version?
    Do you include bugfixes? Like yesterday fixes.
    When 1.5 OCX version comes out you migrate also?
    I have suspended work on the VBFlexGrid.NET for now and have pivoted to migrating the VBFlexGrid to a native ActiveX control written with C++ and ATL.

    A native ActiveX control should work better with traditional ActiveX consumers like VB6, there being no interop or .NET Framework issues, while providing 64-bit compatibility for modern Office.

    RD

Page 17 of 17 FirstFirst ... 714151617

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