Bind DataTable to WPF DataGrid with Customized Columns?

You need to set the DataGrid's AutoGenerateColumns to false, then specify your own column list. Here's a rough example.

Up vote 0 down vote favorite share g+ share fb share tw.

I want to bind datagrid with datatable, so that it could display and update the data back to the database automatically. But meanwhile I also want to customize the columns of the datagrid, for example for one particular column of datatable, I want to display this column's data in combobox inside the datagrid (the changed data through combobox should be stored back to database as well). How can I do this?

I am new to WPF, so any sample regarding it would be helpful for me. Thanks in advance! Wpf datagrid link|improve this question asked Nov 2 '10 at 11:48Muhammad Imran466 30% accept rate.

I want to display combobox inside grid at runtime. The scenario is my datagrid is connected to datatable, at runtime this grid will be populated with the data of datatable, so at that point I want to display the value of one column in combobox, that should be displayed inside datagrid. I want to create columns of datagrid at runtime as they could vary depending upon datatable.

Any example for doing this... – Muhammad Imran Nov 2 '10 at 16:42.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions