views:

3812

answers:

4

I am fairly new to WPF. I want to develop a datagrid control which supports databinding.

There is a lot of information available about databinding to existing controls, but I cannot find any information how to develop a control from scratch which supports databinding.

I do not expect a simple answer to this question, a link to get me started would be nice.

+2  A: 

Are you planning to build a DatGrid control?. There is one here http://www.codeplex.com/wpf/Release/ProjectReleases.aspx?ReleaseId=14963

Binding is one of the important features of WPF, Dependancyproperty actually gives a control the ability to bind and listen to data change events(Data Binding). When you develop your control you dont need to do anything special to make the DataBinding work, just need to define appropriate Dependency properties to the control,

You can read more about DataBinding here http://msdn.microsoft.com/en-us/library/ms752347.aspx

Jobi Joy
There is a free express edition of Xceed WPF DataGrid too. http://xceed.com/Grid_WPF_Intro.html
liggett78
A: 

Thanks for the answer.

Yes, when I said 'grid' I meant a 'datagrid'. I edited the question to make this more clear.

The article on MSDN main describes how to use databinding, and does not say too much what you have to do if you want to develop a WPF-control which supports databinding.

nruessmann
if you need to write something like this, its better that you modify the question, like you did. But rather than posting it as an answer you should post it as a comment against Joy.
Dheer
A: 

The following learning path will have you solidly on your way

  1. Learn about dependency properties
  2. Write a simple stack panel control - get familar with Arrange and Measure overrides
  3. Use a DP with AffectsArrange to set the orientation
  4. Write a SimpleListBox control - bind to a list of scalars (say List<string> )
  5. Update the SimpleListBox control to support INotifyCollectionChanged
  6. Update the SimpleListBox control to support binding to a property of the list ( say FirstName on List<Person> )
  7. IWeakEventListener
  8. You're probably going to want to support binding to DataTables, so add support for IListSource, ITypedList, IBindingListView, and IBindingList
  9. For good responsiveness, you may need to implement your own virtualizing panel
  10. Add support for templates
Scott Weinstein
A: 

Microsoft released few days ago a DataGrid as part of the WPF Toolkit:

See the WPF Toolkit October 2008 at codeplex

You can use data binding and validation.

decasteljau