private void comboOffice_ValueChanged(object sender, EventArgs e){ //Check if Office in Ultracombo#1 was changed if (comboOffice.Value != null) { string office = comboOffice.Value.ToString(); //comboCurrLoc is the 2nd Ultracombo on the form, should only display sites based on the user's selected office comboCurrLoc.Rows.ColumnFilters.ClearAllFilters(); comboCurrLoc.Rows.ColumnFilters["OFFICE_CODE"].FilterConditions.Add(FilterComparisionOperator.Equals, office); comboCurrLoc.Value = null;}
I feel that I'm close, but when I change the value of the office in Ultracombo#1, the second combobox is blank. Is there something else I should be adding to make the 2nd Ultracombo display the correct values?
Mike,
This makes sense to me, although, I found a work-around for now. I will revisit this later and check the DataTypes.Thank you,Chris
Hi,
Well, if you set the filter and all the rows disappear, the obvious implication is that there are no rows on the list that match the value you applied for the filter. My original guess was that maybe your data was numeric and you were filtering by a string and therefore nothing matched up.
There are no fixed-length strings in DotNet, though, so I wonder what DataType the column in the dropdown is actually using. Maybe it's not a string. Or maybe the issue is that the strings on the dropdown list are fixed-length, so your filter needs to append extra space so that you make sure it matches the item on the list exactly.
The second combo does not display any rows, but does show the column headers. The OFFICE_CODE value is a vachar2(3) data type (Oracle), that's why I'm converting it to a string. So I understand, if I use this statement:comboCurrLoc.Rows.ColumnFilters["OFFICE_CODE"].FilterConditions.Add(FilterComparisionOperator.Equals, office);This will filter rows so that only the rows that have the specific office value (passed in) are displayed, correct? I assume if I do a Row.Count() before and after this statement, I should see if it's being applied correctly? I forgot to mention that I also changed the .DisplayLayout.Bands(0).Override.RowFilterAction property to "HideFilteredOutRows". Could this be causing a problem?
When you say "the second combo is blank", what exactly do you mean? There are no rows on the list? Do you still see the column headers? If there are column headers and no rows, then it sounds to me like you are filtering out ALL of the rows. If the OFFICE_CODE value a string field? Seems like this is some kind of key field and is probably numeric. If that's the case, why are you converting the filter value to a string?