skillsboy
2019-07-29T09:49:20Z
If i use "igCellCombo" it works fine, it shows the "State" instead of its ID.
But when I try using the "igCellTextCombo" it shows the "StateID" in the cells and the "State" names in the dropdown, I would like to see the "State" in the cells like when i use "igCellCombo" if possible.

    Dim rsMain As DAO.Recordset
    Dim rsSate As Dao.Recordset
    Dim State  As ComboObject

    Set rsMain = CurrentDb().OpenRecordset("qry_Main")
    Set rsState = CurrentDb().OpenRecordset("tbl_State")     'SELECT StateID, State FROM tbl_State;
    Set State = iGrid2.Combos.Add("State")
    
    State.FillFromRS rsState, "State", "StateID"
        
    With iGrid2.AddCol(sKey:="State", sHeader:="State")
        .eType = igCellTextCombo
        .sCtrlKey = "State"
    End With
    
    iGrid2.FillFromRS rsMain

    Set rsMain = Nothing
    Set rsState = Nothing
Igor/10Tec
2019-07-29T15:09:12Z
The igCellTextCombo cell type implies that you can enter any arbitrary text into the cell. In this case the attached drop-down list can be used only as the source of strings for fast input without any link to hidden values (IDs) because in the general case there is no corresponding ID for any arbitrary string.
skillsboy
2019-07-29T15:27:24Z
Ok then I will use "igCellCombo".

But there is a thing I can't do while using "igCellCombo", i want to copy a cell from this column and paste it in one or more cells from the same column. It says type mismatch.

Is there any possible way around this?
Igor/10Tec
2019-07-30T10:51:38Z
As you may know, iGrid tries to convert the value you put into a cell to the type of the existing cell value - no matter whether it is interactive text editing or copy/paste. When you copy the contents of a combo box cell and pastes it into another combo box cell, actually iGrid copies the value of the source combo item and tries to convert it to the type of the values in the destination cell. If this process fails, you see the error. This can happen if both cells use the same combo list but the values of its items have different data types.

If you can reproduce the problem in a simple project and send it to us (or publish here), we can discuss how to change your code to avoid this problem.
skillsboy
2019-08-01T10:12:21Z
Originally Posted by: Igor/10Tec 

As you may know, iGrid tries to convert the value you put into a cell to the type of the existing cell value - no matter whether it is interactive text editing or copy/paste. When you copy the contents of a combo box cell and pastes it into another combo box cell, actually iGrid copies the value of the source combo item and tries to convert it to the type of the values in the destination cell. If this process fails, you see the error. This can happen if both cells use the same combo list but the values of its items have different data types.

If you can reproduce the problem in a simple project and send it to us (or publish here), we can discuss how to change your code to avoid this problem.



Here is small sample project.

What I would like is to copy one cell to multiple cells all this in the "Sec" column.

I appreciate the help.


ps: i can't upload ".accdb", nor could I upload ".png", so here is what I have.

Option Compare Database

Private Sub igrid1_formating()
'formatting
    With iGrid1.Header
        .ForeColor = vbBlack
        .Font.Size = 12
        .Font.Bold = True
        .UseXPStyles = False
    End With

    With iGrid1.Font
        .Size = 10
    End With

    With iGrid1
        .AutoHeightRows
    End With
    
    For iCol = 1 To iGrid1.ColCount
       iGrid1.AutoWidthCol iCol
    Next
End Sub

Private Sub Form_Load()
    Dim rsMain  As DAO.Recordset
    Dim rsSec   As DAO.Recordset
    
    Dim Sec     As ComboObject
    
    Set rsMain = CurrentDb().OpenRecordset("tbl_Main")
    Set rsSec = CurrentDb().OpenRecordset("tbl_Sec")
    
    Set Sec = iGrid1.Combos.Add("Sec")
    
    iGrid1.BeginUpdate
    
    'properties
    iGrid1.MultiSelect = True
    
    'populate dropdowns
    Sec.FillFromRS rsSec, "Sec", "SecID"
    
    'add columns
    With iGrid1
        With .AddCol(skey:="MainID", sHeader:="ID")
        End With
        With .AddCol(skey:="SecID", sHeader:="Sec")
            .eType = igCellCombo
            .sCtrlKey = "Sec"
        End With
        With .AddCol(skey:="Other", sHeader:="Other")
        End With
    End With
    
    'populate columns
    iGrid1.FillFromRS rsMain
    
    'formatting
    Call igrid1_formating

    iGrid1.EndUpdate
    
    Set rsMain = Nothing
    Set rsSec = Nothing
End Sub

sample.png
Igor/10Tec
2019-08-02T15:15:40Z
Can you pack and send us the .accdb file demonstrating the problem to our main support address (contact@10tec.com) for the further consideration?

Have you tried to upload the .accdb file packed into a .zip archive to this forum?
skillsboy
2019-08-02T16:26:00Z
  copy 1cell to multiple cells combobox-sample.rar (30kb) downloaded 12 time(s).

I dind't see i could upload zip, rar...

Do you still want me to send it to the email?

What I would like to do:
- Copy one cell from "Sec" column (combobox) to one or more cells in "Sec" column (combobox).

Example:
1-Copy Value from [Sec] where [ID]=2
2-Paste that Value to [Sec] where [ID]=4 & [ID]=6

What happens:
1-"Thanche 1" is copied to clipboard
2-When pasted error occurs: "Invalid value: Type mismatch"

This only happens on comboboxes/dropdowns, I guess because they save two different values CellValue & CellText.
Igor/10Tec
2019-08-05T10:31:59Z
I reproduced the problem under the debugger and know why it occurs.

Let's discuss possible ways to solve this problem in emails.
Igor/10Tec
2019-08-06T08:25:59Z
skillsboy, we sent you a link to an interim build of iGrid with the bug fix and some related questions to your email. Have you received it? If not, check the Junk Emails folder. Perhaps, our letter was placed in it mistakenly by your anti-spam filter.
skillsboy
2019-08-06T09:17:13Z
Originally Posted by: Igor/10Tec 

skillsboy, we sent you a link to an interim build of iGrid with the bug fix and some related questions to your email. Have you received it? If not, check the Junk Emails folder. Perhaps, our letter was placed in it mistakenly by your anti-spam filter.



Yes I did receive it, thank you!

I wasn't available yesterday, but I will reply to the email today.