Answer the question
In order to leave comments, you need to log in
How to get the value from the first cell of the selected row?
I'm making an application in visual studio WPF, connected the database via ADO. I am displaying data in the datagrid, but now I have encountered such a problem that I need to double-click on any cell of any row and automatically the program should determine on which row the cell that I poked is located and take the value from the first field from this row and display. (the first field is a counter, I need to find out the number of this line, on the cell of which the person has poked, in order to do other actions in the future) How can this be solved? what ways besides MVVM
Answer the question
In order to leave comments, you need to log in
maybe someone will come in handy. Working code
var printertable = NormApparatYchetEntities2.GetContext().PrinterTable.ToList();
var currentItem = (PrinterTable)((FrameworkElement)sender).DataContext;
MessageBox.Show(currentItem.IdPrinter.ToString());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question