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
1475
Multi Select In a WinGrid Cell
posted

Hi-

I have a grid in my form where in, from a particular column the user can select multiple items.So I have a text box with button control set to a win grid having check boxes. One more requirement is some of the rows should be pre-selected based on the values coming from a query from the database. Everything is working fine except when I get duplicate entries from the query. I can't modify the query not to return duplicates. So my problem is, when I get duplicate entries from the query I shouldn't add those to the ValueList property of the cell.

So I wrote a small code to restrict these duplicate entries like the below. But some how Contains method is returning false if it has a value in it.

       If (condition met) Then
                                        If Not v1.ValueListItems.Contains(Value) Then
                                            v1.ValueListItems.Add(Value)
                                        End If
                                    End If

I tried using two overloads that Contains have. e.g. v1.ValueListItems.Contains(New Infragistics.Win.ValueListItem("value")) but still of no use.  Could it be a bug ?

Thanks in advance.

-Swe2.

Parents Reply Children
No Data