.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links


Posted By:      Posted Date: September 29, 2010    Points: 0   Category :WPF

Hi, I'm make a control like a DatePager, and i dont now how to create a ItemSource property to bind in gridview.

My question is.

How to create a ItemSource or implement an ItemSource in a custom control, to binding in another itemsource like datagrid.


View Complete Post

More Related Resource Links

WPF ListBox doesn't Group items if I don't use ItemSource.


WPF ListBox doesn't Group items if I don't use ItemSource.

This code snippet works but I use



private ObservableCollection<

Updating combobox itemsource from another combobox selection is slow


Hi everybody!

I'm developing a WPF application that needs a combobox updating another combobox items when selection changes.

I isolated the code and the problem is still there, when i change the first selection and then click the other it takes a lot of time (IMHO) 


namespace TestCombobox
 /// <summary>
 /// Interaction logic for MainWindow.xaml
 /// </summary>
 public partial class MainWindow : Window
  private List<string> methodsList;
  private Dictionary<string, List<string>> dict;

  public MainWindow()

   dict = new Dictionary<string, List<string>>();


CollectionViewSource - problem filtering an ItemSource


I am trying to filter out duplicate items from a combo box. The items themselves are not duplicates, but I use a string value called "Name" to populate the combo box, and I only want one instance of that "Name" to show up.

Attached is a somewhat contrived example, but it shows the essence of what my problem is. I have a CollectionViewSource event handler called CollectionViewSource_Filter where I thought that I could get hold of the ItemsSource or CollectionViewSource and detect whether or not I have that string value already in the combo Box. If you compile and run the code, you see that all the items from the DataContext appear and duplicates are are not filtered out.

<Window x:Class="TestCombo.Window1"
  Title="Window1" Height="300" Width="300">
  <StackPanel Orientation="Horizontal">

Binding itemsource for 1 combo box column from another combo box column in a datagrid


Have a hierarchical list of data that the user can select values from, however they have to select the second item from a list that is restricted based on the entry selected in the first combo box.


Item a

  • item 1
  • item 2
  • item 3

Item b

  • item 1
  • item 4
  • item 5
  • item 6

Item C

  • item 2
  • item 3
  • item 5
  • item 6

Does anyone have any ideas about how to go about populating the first and second combo boxes so that this would work?

How to add validation rule programmatically on datagrid column, whose itemsource is datatable?

I want as user ends editing a datagrid cell, a validation rule should be applied on this cell for error checking like whether its value is null or not and in case of null it should display the error on that cell. All this i want to do programmatically not in xaml. Can anybody guide me with an example ?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend