插入复选框列表的选中项目 [英] insert checked item of checkbox list
本文介绍了插入复选框列表的选中项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请告诉我硬件要保存复选框列表中所有选中的项目.我以前从未使用过复选框列表...
Hi, plz tell me hw to save all the checked item of checkbox list. I never used checkbox list ever before...
推荐答案
因为这是Windows窗体,您可以使用 ^ ]或使用 ^ ]
Taken this is Windows Forms, you can fetch the selected items using SelectedItems[^] or the indices using SelectedIndices[^]
在您的按钮单击事件中编写此代码.
名称选择"是网格中您的复选框的名称.
假设cgd是您的网格.
Write this codes inside your button click event.
The name "Select" is the name of your check list box in your grid.
Assumes that cgd is your grid.
If cgd.Rows > 1 Then
For i_count As Integer = 1 To cgd.Rows - 1
If Convert.ToBoolean(cgd.Item(i_count, "Select")) Then
//Write the code for saving your values to database
End If
Next
End If
它将仅将选中的项目保存在网格中.
It will saves only the checked items in the grid.
这篇关于插入复选框列表的选中项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文