Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Get all unique values from a column
posted

I'm in the process of converting over janus grids to infragistics grid (UltraWinGrid) and am stuck on a certain part of it. I need to get a list of all unique values for each column. In janus grids, there is a 'ValueList' collection that can be obtained for each column and will give you the list of unique values. In infragitsics, I did find that there is also a 'ValueList', but it does not appear to do what I need. What is the best way of getting a list of all unique value? I have quite a few columns, so it needs to be somewhat efficient. By the way, this is for windows and I'm using VB.net

Any help would be appreciated.

Parents
  • 17259
    Offline posted

    The value list is for displaying friendly user strings instead of values, like setting a data source to a combobox.

    You can loop through the rows and get the values, but you can do it also with the datasource.

    With the rows:

    grid.Rows.Select(r => r.GetCellValue(columnName))

Reply Children
No Data