How to solve this combo box issue in datagridview in .net winforms?
i had two combobox(Catogery, product) in my grid. what i want to do is. if i select category i开发者_运维百科t will display some data set value based on category, and if i select product it will bind some values in that datagrid cells.like price quantity..
i don't have idea about how to write event for combo box selected index change event which is inside the grid.
Handle the CellEndEdit
event on the DataGridView. You'll have to test that the sender is the correct DataGridViewComboBoxColumn, read the value, and use that to bind the other DataGridViewComboBoxColumn to the appropriate data source.
I'm not sure about that, because I don't have visual studio at the moment. But there must be an event called RowCellValueChanged event, write your code in this event, hand row index with EventArgs e and set your values to row which you have an index of row.
精彩评论