728x90
반응형
|
//A DataGrid의 셀을 선택하면, 다른 DataGrid의 행을 읽어온다.
private void Datagrid_Stock1_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
{
try
{
DataRowView dataRow = (DataRowView)datagrid_news_all.SelectedItem;
string s1 = dataRow.Row.ItemArray[3].ToString();
|
cs |
DataRowView dataRow = (DataRowView)datagrid_news_all.SelectedItem;
이렇게 읽어오고
dataRow.Row.ItemArray[3].ToString();
0~ 해당 컬럼번호로 접근한다.
728x90
반응형
'다양한 실전소스코드 > WPF(C#)' 카테고리의 다른 글
[Solved] C# WPF Width Height Length Set in code (Xmal 50* 값 입력 방법) (0) | 2021.06.27 |
---|---|
[Solved] C# WPF MSSQL DB to DataGrid (DB의 값을 테이블에 뿌릴때) (0) | 2021.06.27 |
[Solved] C# WPF DataGrid Get Other Contrl value by Selected Control (선택한 컨트롤의 정보로, 다른 컬럼 컨트롤 값 얻기) (0) | 2021.06.27 |
[Solved] C# WPF Other Page Access ( WPF 다른 페이지 참조 ) (0) | 2021.06.27 |
[Solved] C# WPF Button Content 알아내기 (Click) (0) | 2021.06.27 |
댓글