Answer the question
In order to leave comments, you need to log in
Value outside datagrid window?
var c2 = new DataGridCellInfo(gvData.Items[i], gvData.Columns[1]);
var c3 = new DataGridCellInfo(gvData.Items[i], gvData.Columns[2]);
var content2 = c2.Column.GetCellContent(c2.Item) as TextBlock;
var content3 = c3.Column.GetCellContent(c3.Item) as TextBlock;
if (content3 != null && content2 != null)
{
kj += content3.Text + ":" + content2.Text + "\r\n";
}
Answer the question
In order to leave comments, you need to log in
On a good note, you need to change the approach and work with the data source (which C Sharp
wrote about ).
The DataGrid is just a display and should not be used as a DataGridView from WinForms.
Create a class. Then create an ObserbvaleCollection from the elements of this class.
Set the itemssource property to the created collection. Enjoy and
write freely. Your hands will be untied. And the search for such solutions will take a mountain of time wasted as a result.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question