Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

wpf DataGrid MouseUp

$
0
0

I'm new in wpf:

Two sql tables then I have two DataGrids

using MouseUp event for DataGrid1 row must load table2 database data into DataGrid2 by a common column in both tables.

Tabel1
RequestID(int)  RequestName(NVarchar)

Table2
Name(NVarchar)  Numbers(int)  RequestID(int)

This code is winform

 private void gridRequests_MouseUp(object sender, MouseEventArgs e)
        {
            DataTable dt = new DataTable();
            DataBase db = new DataBase();
            try
            {
                s = gridTable1[0, gridRequests.CurrentRow.Index].Value.ToString();
                dt = db.MySelect("select * from Table2 where RequestID='" + s + "'");
                gridTable2.DataSource = dt;
                gridTable2.Columns[0].HeaderText = "RequestID";
                gridTable2.Columns[1].HeaderText = "Name";
                gridTable2.Columns[2].HeaderText = "Numbers";
            }
            catch { }
How can use in wpf?

mhshojaee


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>