I am trying to highlight the valuelistitem in the row filter dropdown that represents the current column filter comparevalue.
I have tried the following to no avail:
If
Me.dgDF.DisplayLayout.Bands(0).ColumnFilters(e.Column.Key).FilterConditions.Count > 0 Then
e.ValueList.SelectedItem =
CType(e.ValueList.FindByDataValue(Me.dgDF.DisplayLayout.Bands(0).ColumnFilters(e.Column.Key).FilterConditions(0).CompareValue), ValueListItem)
End If
I have read that SelectedItem only works when the editor for the control is an EditorWithCombo, but I can't find a way to access and change the editor or know if I am even heading in the right direction.
Is there a way to highlight an item in the BeforeRowFilterDropDown eventhandler just as it is highlight when the Mouse hovers over an item?
Thanks for your help
You can do something like this to initially select one of the items:
void ultraGrid_BeforeRowFilterDropDown(object sender, BeforeRowFilterDropDownEventArgs e){ UltraGrid control = sender as UltraGrid; UltraGridFilterRow filterRow = control.ActiveRow as UltraGridFilterRow;
if ( filterRow != null ) { UltraGridCell activeCell = filterRow.Cells[e.Column]; EditorWithCombo editor = activeCell != null ? activeCell.EditorResolved as EditorWithCombo : null;
if ( editor != null ) { // Assign the text of the filter dropdown item that is // to be initially selected. editor.Value = "whatever"; } }}
I'm sorry, I wasn't clear. I am not using a filter row for filter but rather the filter icons in the column headers. Currently the only way to highlight an item in the filter drop down is to hover over it. What I would like to do is to have the current compare vale of the column filter condition highlighted when the user clicks the filter icon and the dropdown drops down.
My guess is that this is impossible but you have surprised before.
Thanks
Just to be clear, the point I was trying to make is that you should try using the AfterRowFilterListDropDown, instead of BeforeRowFilterListDropDown. This is a new event that was added in a recent service release.
Are you refering to Infragistics 2010v2? Something later? I'm using 2010v2 and I see no such event handler.
Hello,
In the base release of the NetAdvantage 2010 volume 2 there is no such event which probably you are using. But in the latest service release for NetAdvantage 2010 volume 2 this event is added. You could download and verify this by downloading the latest service release available.
Please take a look at the following forum thread if you don't know how to get it:
http://community.infragistics.com/forums/t/29398.aspx
Let us know if you need any further assistance.
I updated the application with the latest service release associated with our key and still no AfterRowFilterListDropDown eventhandler. The service release we downloaded was 10.2.20102.2026. Is this the release you refered to?
Hi,
Sorry for the confusion, I think I must've mixed up the events. The event was actually added back in Novemeber of 2009, but it's called AfterRowFilterDropDownPopulate. There is no AfterRowFilterDropDown event. This probably won't work for what you want to do here.