We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Drop Down Filter

Thread ID:

Created:

Updated:

Platform:

Replies:

58899 Mar 30,2007 08:02 AM Apr 3,2007 03:10 AM Windows Forms 4
loading
Tags: GridControl
Vicko Hazdovac
Asked On March 30, 2007 08:02 AM

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

haneefm [Syncfusion]
Replied On March 30, 2007 10:37 AM

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

Vicko Hazdovac
Replied On April 2, 2007 04:41 AM

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

haneefm [Syncfusion]
Replied On April 2, 2007 07:33 PM

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

Vicko Hazdovac
Replied On April 3, 2007 03:10 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;