List for WinForms

How to Hide Column

  •  TRIMS9 said 10 months, 2 weeks ago:

    I am working with C1Combo and trying to Hide column.
    Am using datamode ADDITEM
    In Designer I have indicated that 3rd column Visible=False and it does not appear in designer.
    When I run program the third column is still displayed.
    What am I missing?

    Also, how do I attach pictures to this forum? I’ve tried jpg and png files but it say there’s a problem with the file extension.

  •  Reema40p said 10 months, 2 weeks ago:

    Hello,

    I am unable to reproduce the said behavior with the latest build : 4.1.20122.204, that is, the following line of code works correctly at my end & hides the first column from the Combo :

    c1Combo1.Splits[0].DisplayColumns["Column 1"].Visible = false;
    

    Please check the case with the latest build, which you can download from the following link:

    http://prerelease.componentone.com/dotnet40/C1List/2012-T2/

    If the issue still persists, then send me a small sample of your code replicating the issue so that I could debug it at my end & provide you with further assistance.

    Regards,
    Reema

  •  TRIMS9 said 10 months, 2 weeks ago:

    Reema:
    Yes, that works for me – I was not setting Visible False in Code – I had set it false in the designer and properties.

    Also, I’m having trouble attaching images to messages in this forum.
    I try to attach JPG or PNG files as illustrations but get message relating to problem with file extension. Cannot delete file name and have to re-start a new post without image.

    Need some assistance with this please.

    Thanks,

    Lee

  •  Reema40p said 10 months, 2 weeks ago:

    Hello Lee,

    I checked the case & was able to attach the .png & .jpg files.
    It might be possible that the file size is greater than 5MB or the format you used might not be correct.

    Also, you may zip your files & could attach the zip folder.

    Regards,
    Reema

  •  TRIMS9 said 10 months, 2 weeks ago:

    Am unable to attach files using IE-9 or FireFox.

    using: C:G12reportsCapture1.PNG I get message
    "one of your file extensions is not allowed"

    Thanks for the followup.

  •  Reema40p said 10 months, 2 weeks ago:

    Hello Lee,

    Try using .png instead of .PNG.

    Regards,
    Reema

  •  TRIMS9 said 10 months, 2 weeks ago:

    Hmmm thats interesting.
    I pasted file name into message from Attach Files File name and it removed the back slashes.

    C:G12reportsCapture1.PNG

    Should have been C:G12reportsCapture1.PNG

  •  TRIMS9 said 10 months, 2 weeks ago:

    I’ll Try again

    Attachments:
    You must be logged in to view attched files.
  •  TRIMS9 said 10 months, 2 weeks ago:

    Thanks, I’ll be certain to watch casing on upload file names.

    Lee

  •  TRIMS9 said 10 months, 2 weeks ago:

    I do have another question regarding Combo/List Control

    I Have a combo box loaded using AddItem
    Three columns with data similar to:
    10290;Robertson;A4
    40129;Peterson;V9
    13409;Jackson;W2
    20498;Florida;G2

    How do I do a program search of the list data to find row containing "W2″ in column 2

    The following works but there must be a better way – can you show me?

    Dim i As Integer
    For i = 0 To C1Combo1.ListCount – 1
    C1Combo1.SelectedIndex = i
    If C1Combo1.Columns.Item(2).Text = "W2″ Then Exit For

    Next

    Lee

  •  Reema40p said 10 months, 2 weeks ago:

    Hello Lee,

    For information regarding Searching in C1List/C1Combo, please refer to the following link :

    http://helpcentral.componentone.com/nethelp/c1list/#!Documents/searchingandfieldcom.htm

    Let me know if this works for you or not.

    Regards,
    Reema

  •  TRIMS9 said 10 months, 2 weeks ago:

    Reema:

    I looked at the document you referenced and Found that there is a c1List.Find method available but that is only for the LIST control. Did not see any methods relating to searching a c1Combo.

    I need a search function to locate text in a specific Column in a c1Combo.

    Can you show me an example of code to find index pointing to row containing "ABC" in column 2 of c1Combo

    Thanks,

    Lee

  •  Reema40p said 10 months, 2 weeks ago:

    Hello Lee,

    If you need to find records in a Column of C1Combo, you may use the FindString() or FindStringExact() methods of C1Combo but they will search the records contained in the Display Member column only.

    To find the records in any Column of the Grid, you may try the following workaround :

     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ' Set the DataMode for C1Combo
            C1Combo1.DataMode = DataModeEnum.AddItem
            ' Populate the C1Combo with data
            C1Combo1.AddItemTitles("Value;Company")
            C1Combo1.DisplayMember = "Company"
            C1Combo1.ValueMember = "Value"
            C1Combo1.AddItem("10;ABC")
            C1Combo1.AddItem("11;IJK")
            C1Combo1.AddItem("12;DEF")
            C1Combo1.AddItem("13;PQR")
            C1Combo1.AddItem("14;XYZ")
         
        End Sub
    
        ' On the Click of Find Button – find the record specified in textbox1 & display it in textbox2
        Private Sub FindBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FindBtn.Click
            Dim dt As DataTable = DirectCast(C1Combo1.DataSource, DataTable)
            Dim dv As DataView = dt.DefaultView
            dv.Sort = "Company"           'specify the column name in which you want to search
            TextBox2.Text = dv.Find(TextBox1.Text)
        End Sub
    

    Please refer to the attached sample for the implementation details.

    Let me know if this works for you or not.

    Regards,
    Reema

    Attachments:
    You must be logged in to view attched files.
  •  TRIMS9 said 10 months, 2 weeks ago:

    Reema:
    Your example works with the data you’ve provided but fails to provide the row index of the combo when data is given in the following manner…

    C1Combo1.AddItem("14;ABC")
    C1Combo1.AddItem("13;IJK")
    C1Combo1.AddItem("12;DEF")
    C1Combo1.AddItem("11;PQR")
    C1Combo1.AddItem("10;XYZ")

    If we sort and search on Value, searching for value =10 returns 0 rather than 4,
    consequently C1Combo1.SelectedIndex = 0 will highlight 14;ABC rather than 10;XYZ

    Lee

  •  Reema40p said 10 months, 2 weeks ago:

    Hello Lee,

    This is because when using the Sort property on Company Column, I have not specified the order in which to sort the data in the DataView & by default the sort order is ascending, so it is sorting the data in the Company Column in ascending order & displaying the result accordingly.

    Since you have changed the data to descending order, you can specify the sorting order in the Sort property of the DataView & the Find method will display the result accordingly.

    Here is what you can do :

    dv.Sort = "Company DESC"
    

    Hope this helps.

    Regards,
    Reema

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.