如何在数组中收集datagriedviewchekbox选定的值 [英] how to collect datagriedviewchekbox selected value in array
本文介绍了如何在数组中收集datagriedviewchekbox选定的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望收集datagriedview内部的chekbox的值并分别传递给每个值加倍。 Plz帮助我。 M试了好久。
Ii want to collect value of chekbox which is inside of datagriedview and pass to double each value seperatly. Plz help me. M tried from long time.
推荐答案
试试这个: -
Try this:-
protected void btnClick_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
DataGridViewCheckBoxCell chk = row.Cells[0] as DataGridViewCheckBoxCell;
if (Convert.ToBoolean(chk.Value) == true)
{
//Add code here for adding into array
}
}
}
这篇关于如何在数组中收集datagriedviewchekbox选定的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文