Drop Down Filter

Hello
I'm having trouble with the filter bar in gridgrouping control.
It works fine with the mouse, but if I navigate through it with the keyboard it does absolutely nothing. (it doesn't matter if I press Enter, Tab or space)
I've attached an example for you to see where the problem is.


Test_Filter.zip

4 Replies

HA haneefm Syncfusion Team March 30, 2007 02:37 PM UTC

Hi Vicko,

you can try this code

void gridGroupingControl1_TableControlKeyDown(object sender, GridTableControlKeyEventArgs e)
{
if (e.Inner.KeyData == Keys.Tab
|| e.Inner.KeyData == Keys.Enter
|| e.Inner.KeyData == Keys.Right)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = cc.Renderer.CurrentStyle as GridTableCellStyleInfo;
if (cc.IsDroppedDown
&& style != null
&& style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.FilterBar)
{
cc.MoveTo(cc.RowIndex, cc.ColIndex + 1);
e.Inner.Handled = true;
}
}
}

Best regards,
Haneef


VH Vicko Hazdovac April 2, 2007 08:41 AM UTC

It seems there's been a little misunderstanding, and it's my fault. I didn't describe my problem as well as I should have...
I didn't ask to be able to move through the columns using the keyboard (although it came in very handy, and I thank you for that). But, my problem is something else. Since I don't actually know how to describe it clear enough in a few words I've attached this word document with screenshots so you can see where the troubles lie. You know what they say : "Picture is worth a thousand words" :)

DropDownTroubles.zip


HA haneefm Syncfusion Team April 2, 2007 11:33 PM UTC

Hi Vicko,

One way you can do this by hanlding the TablecontrolCurrentCellCloseDropDown event of the grid and call the filterbarRender.Model.Select() method to set the filter in a grid. Here is a code snippet

GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableFilterBarCellRenderer cr = (GridTableFilterBarCellRenderer)cc.Renderer;
if (cr != null)
{
GridTableCellStyleInfo tableStyleInfo = e.TableControl.Model[cc.RowIndex, cc.ColIndex]; ;
GridTableCellStyleInfoIdentity tableCellIdentity = tableStyleInfo.TableCellIdentity;
cr.Model.Select(tableCellIdentity, cr.ListBoxPart.SelectedIndex);
cr.SetTextBoxText(cr.GetFilterBarText(tableStyleInfo), false);
}

Best regards,
Haneef


VH Vicko Hazdovac April 3, 2007 07:10 AM UTC

This is exactly what I needed. Thank you very much.

Loader.
Up arrow icon