Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7490523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:40:13+00:00 2026-05-29T15:40:13+00:00

first: we use infragistics xamdatagrid 11.1.20111.2053 our problem: We use the grid with generic

  • 0

first: we use infragistics xamdatagrid 11.1.20111.2053

our problem:

We use the grid with generic lists. So it’s very dynamic and must be prepared for any situation. We set for each field type theSortComparer, FilterComparer, the editor type, Edita type and style editor.
For some properties of a model, we use special TypeConverter.
For example, in a cell, some values ??can not be displayed.

0 = string.Empty
1 = 1
2 = 2

first solution, we only use the type converter and a special sort comparer:

public class HideZeroIntEntryConverter : Int32Converter
{
  public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) {
    if (value is int) {
      if (destinationType == typeof(string)) {
        return ((int)value != 0) ? value.ToString() : string.Empty;
      }
      return ((int)value != 0) ? value : Binding.DoNothing; // this is the best solution to tell the grid the cell is empty
    }
    return base.ConvertTo(context, culture, value, destinationType);
  }
}

this works perfect if we not decide to filter, but if we want to filter the values we see the ugly “Binding.DoNothing” in the filter drop down items (the sorting and filtering is also wrong).
also, we can not filter for “0” because we the converter says string.empty…

second solution, we use a special XamTextEditor:

public class HideZeroIntEntryTextEditor : XamTextEditor
{
  public HideZeroIntEntryTextEditor() {
    this.ValueToDisplayTextConverter = new HideZeroIntEntryValueConverter();
  }
}

public class HideZeroIntEntryValueConverter : IValueConverter
{
  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
    if (value is int) {
      if (targetType == typeof(string)) {
        return ((int)value != 0) ? value.ToString() : string.Empty;
      }
      // this never happens
      return ((int)value != 0) ? value : Binding.DoNothing;
    }
    // this never happens
    return targetType == typeof(string) && value != null ? value.ToString() : value;
  }
}

and for the field settings

  field.Settings.EditAsType = typeof(int);

  field.Converter = null;
  field.Settings.EditorType = typeof(HideZeroIntEntryTextEditor);
  field.Settings.SortComparer = GenericComparer<int>.Instance;
  field.Settings.FilterComparer = GenericComparer<int>.Instance;
  field.Settings.GroupByComparer = GroupByRecordComparer<int>.Instance;

Now we can filter to “0”, even if this does not appear in the list.

But, in both cases, we can not filter by empty entries, because it actually does not exist!
We want to though!
In our opinion, this could be if we could make our own special filter. But this is unfortunately not so easy.
Yes, we can remove the special filter blanks and NonBlanks, BUT that applies to all grids.
A special filter to override is very complicated and does not even correct.

Ok, we want see empty cell, and want filter this cells, but the special filter doesn’t works correct!

What can we do, any ideas?

here is the question at infragistics

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:40:14+00:00Added an answer on May 29, 2026 at 3:40 pm

    I answered this on the Infragistics forums right here with a sample.

    You can use the RecordFilterDropDownPopulating event to remove the existing FilterDropDownItem for “(Blanks)” and replace it with a custom one for the value of 0 when the editor for the field is HideZeroIntEntryTextEditor. The following code accomplishes this:

    void XamDataGrid1_RecordFilterDropDownPopulating(
      object sender, 
      //Infragistics.Windows.DataPresenter.Events.
      RecordFilterDropDownPopulatingEventArgs e) 
    {
      if (e.Field.EditorTypeResolved == typeof(HideZeroIntEntryTextEditor)) {
        bool found = false;
        int index = 0;
        while (index < e.DropDownItems.Count && !found) {
          FilterDropDownItem item = e.DropDownItems[index];
          if (item.DisplayText == "(Blanks)") {
            e.DropDownItems.Remove(item);
            e.DropDownItems.Insert(index, new FilterDropDownItem(
              new ComparisonCondition(ComparisonOperator.Equals, 0), "(Blanks)"));
            found = true;
          }
          index++;
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I divide dynamic websites into two types: The first one use e.g PHP ,
I know one awkward solution for this taks will be : first use ct
we want to have the second biggest element. We first use ANY to exclude
first time use JTree. Just wondering is it possible to have more than one
I want to lazy load of @Lob properties. First ,i use javassist to instrument
First off I use this code to make the navigation bar always stay fixed;
First attempt to use this cool site - after searching for 2 hours: So
I use my first query to get the id and name of the user
I just use foursquare first time, looks it find my location and shows on
Its my first time to use web service in iOS. REST was my first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.