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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Data ID''s in FilterBoxes instead of values

Thread ID:

Created:

Updated:

Platform:

Replies:

51742 Nov 13,2006 02:15 PM UTC Nov 14,2006 12:07 PM UTC WinForms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 13, 2006 02:15 PM UTC

Hi!
I'm using Essential Studio 3.2.1.0
I met such a problem with filtering in GridGroupingControl.
If i try to filter column with non-numerical values?
in filterboxes there are id's of filtering values instead of values, though in the grid it is ok.

And corresponding problem. If I try to create Custom filter in runtime, I see GUID's of columns in Members window instead of columns' names

Administrator [Syncfusion]
Replied On November 14, 2006 06:54 AM UTC

Hi Flashnik,

I have created the sample as per your requirement. The attached sample implements owner drawing in a listBox control of a dropdown filterbar. It displays the 'Value' column items in the dropdown list of the 'ID' column. Please try the sample and let me know if this helps.

Here is a sample
http://www.syncfusion.com/Support/user/uploads/ChangeFilterDropDown_cb6feca9.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On November 14, 2006 10:41 AM UTC

Thank you, your sample is very useful.
Still, I encounter problems if I use my dictionary to substitute numerical values by their dictionary meanings. In the grid these values are substituted, but in filterboxes I see numerical values. How can I substitute values in filterboxes?

Administrator [Syncfusion]
Replied On November 14, 2006 11:24 AM UTC

Hi Flashnik,

You can handle the ListBoxPart.DrawItem event and draw the substituted values to the dropdown listbox control. Before handling the DrawItem event, you should set the ListBoxPart.DrawMode property to DrawMode.OwnerDrawFixed in CurrentCellShowingDropDown event. Here is a sample code snippet.

int savedIndex = -1;
string SelectedText = string.Empty;
private void ListBoxPart_DrawItem(object sender, DrawItemEventArgs e)
{
//Declare the SavedIndex as the Class Member.....
//int savedIndex = -1;
ListBox list = sender as ListBox;
StringFormat format = new StringFormat();
format.LineAlignment = StringAlignment.Center;
format.Alignment = StringAlignment.Center;

RectangleF rect = new RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height);

///// dText is the drawing text of the DropDown listBox
//// dText is the DisplayText of the DropDown listBox
//// you can assign any of the text to dText here
////--------------------------------------------------------------------------------------------------------////
string dText = list.Items[e.Index].ToString();
if( e.Index >2)
dText = parentTable.Rows[e.Index - 3]["Value"].ToString();
////--------------------------------------------------------------------------------------------------------////

if (list.SelectedIndex == e.Index )
{
if(savedIndex != -1 && savedIndex != list.SelectedIndex )
list.Invalidate(list.GetItemRectangle(savedIndex));
savedIndex = list.SelectedIndex;
e.Graphics.FillRectangle(Brushes.Gold, e.Bounds);
e.Graphics.DrawString(dText, list.Font, new SolidBrush(list.BackColor), rect, format);
SelectedText = dText;
}
else
{
e.Graphics.FillRectangle(Brushes.LightGoldenrodYellow, e.Bounds);
e.Graphics.DrawString(dText, list.Font, new SolidBrush(list.ForeColor), rect, format);
}
}

Sample : http://www.syncfusion.com/Support/user/uploads/ChangeFilterDropDown_cb6feca9.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On November 14, 2006 12:07 PM UTC

And is it possible to get the same results using GridRelationDescriptor?

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.

Warning Icon 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.Close Icon

;