xamarin DataGridView行值传递到另一页Textedit1

0x6upsns  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(120)

我正在尝试使用下面的代码将值从DataGridView传递到textEdit1,但它不起作用,请帮助我。我使用SQL查询填充DataGridView,但我无法将行值传递到TextEdit。
编码

private void DataGridView_DoubleTap(object sender, DataGridGestureEventArgs e)
        {
            int[] selectedRowHandles = DataGridViewEmployee.GetSelectedRows();
            TextEdit1.Text = System.Convert.ToString(DataGridViewEmployee.GetRowCellValue(selectedRowHandles[0], "ID"));

        }
Code: for DataGridView Fill Using SQL Query (Only for Reference):

Code
private void Bind_GVhkCL(string text)
        {
            {
                string query = "SELECT Room_No as 'Room No',Room_Status as 'Room Status', S_Time as 'Start Time',E_Time as 'End Time',c_date as 'Create Date'from HK_Chk " + text;
                sqlConnection.Open();
                SqlDataAdapter da = new SqlDataAdapter(query, sqlConnection);
                DataTable dt = new DataTable();
                da.Fill(dt);
                GVhkCL.ItemsSource = dt;
                //GVhkCL.RowHeight = 60; 
                sqlConnection.Close();
            }

        }
ffdz8vbo

ffdz8vbo1#

如果您花时间阅读DevExpress文档,您将看到DataGridGestureEventArgs有一个属性Item
取得对象,指定方格数据列所Map的数据来源项目。

相关问题