|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Microsoft.Windows.Controls;
namespace DataGridFilterLibrary
{
public class DataGridComboBoxExtensions
{
public static DependencyProperty IsTextFilterProperty =
DependencyProperty.RegisterAttached("IsTextFilter",
typeof(bool), typeof(DataGridComboBoxColumn));
public static bool GetIsTextFilter(DependencyObject target)
{
return (bool)target.GetValue(IsTextFilterProperty);
}
public static void SetIsTextFilter(DependencyObject target, bool value)
{
target.SetValue(IsTextFilterProperty, value);
}
/// <summary>
/// if true ComboBox.IsEditable is true and ComboBox.IsReadOnly is false
/// otherwise
/// ComboBox.IsEditable is false and ComboBox.IsReadOnly is true
/// </summary>
public static DependencyProperty UserCanEnterTextProperty =
DependencyProperty.RegisterAttached("UserCanEnterText",
typeof(bool), typeof(DataGridComboBoxColumn));
public static bool GetUserCanEnterText(DependencyObject target)
{
return (bool)target.GetValue(UserCanEnterTextProperty);
}
public static void SetUserCanEnterText(DependencyObject target, bool value)
{
target.SetValue(UserCanEnterTextProperty, value);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.