开发者

How to make popup window auto populate with contents in cell

开发者 https://www.devze.com 2023-03-05 15:30 出处:网络
I have a data grid displaying results from a sql database. What I want to do is make it so that when I double click on a cell in the datagrid, a new window appears where that cell can be edited. I als

I have a data grid displaying results from a sql database. What I want to do is make it so that when I double click on a cell in the datagrid, a new window appears where that cell can be edited. I also would like to have all the info for that cell to be autogenerated into editable fields when the cell is double clicked. Any help or 开发者_JAVA百科links to tutorials is appreciated. Thanks.


Try this DataGridView.CellDoubleClick Event


Did you consider using data binding? Simply put, you can bind your items list to DataGrid, and current item (eg. selected/double clicked) to your edit form's controls (TextBox, Label and whatever else you might have there).

Here are good starting points for windows forms: #1, #2. They cover problem you're facing. You can find data binding tutorials for ASP/WPF easily too, but especially first link covers entire concept pretty well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号