IntroductionThis article will describe the DataGrid in Edit mode while the edit cell requires a list of data. We are going to achieve that using the ComboBox.Crating WPF Application ProjectFire up Visual Studio 2008 and Create a WPF Application and name the project as DatePickerDGWPF.Here is the basic idea of our sample application; we would have sample data with one property that can be selected from a list of values displayed in ComboBox.When the particular cell will be edit mode, we would be able to select from the list displayed in the ComboBox.So let's have a class and have sample data.Now we will add a DataGrid to the Window and design the Columns inside of it.We need to set the ItemSource Property; for that I have created a Class that would generate the list and in XAML I have accessed it and assigned it. The following figures will clarify what I have done:......It seems we are done with the design of our DataGrid columns. Run the application and try to edit the column "Status", you would get ComboBox control to handle the Status List.And when in Edit mode:After Updating:Hope this article helps.
DatePicker in DataGrid in WPF
Hide & Un-Hide DataGrid Column(s) In WPF
Great work. can you tell me how to store "value" and "item" in ComboBox. (To get Different arguments as "SelectedValue" and "SelectedItem")
but I want to open the combo when we write into that "Status" cell.
For example when I add a new row and after adding subject, as I enter a letter in "Status" cell this combo should open.
Plz tell me If we can achieve this one also.
Great. Simple example and very clear.
Thanks for sharing! it is helpful for me !Thanks again!
This is the first article i've read about this control that actually gives propper explaination of how it should work. Thank you sir.