
C#中点击treeview中的节点怎么能够连动dataGridView中的数据库表中相对应的数据行?求解!!!
3个回答
展开全部
给treeview设定nodeclicked事件
在事件处理中,取到选中的值
比如是string selectedValue;
然后以selectedValue作为查询参数,返回绑定到gridview
比如
dataGridView.DataSource = QueryData("select * from table where [ID]=" + selectedValue);
dataGridView.DataBind();
在事件处理中,取到选中的值
比如是string selectedValue;
然后以selectedValue作为查询参数,返回绑定到gridview
比如
dataGridView.DataSource = QueryData("select * from table where [ID]=" + selectedValue);
dataGridView.DataBind();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询