Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# c1.flexgrid多个选定行_C#_C1flexgrid - Fatal编程技术网

C# c1.flexgrid多个选定行

C# c1.flexgrid多个选定行,c#,c1flexgrid,C#,C1flexgrid,如何知道用户是否进行了单行选择和多行选择。我使用以下代码: if(grdSearch.Row==grdSearch.RowSel) { MessageBox.Show("single row selected"); } else { MessageBox.Show("multiple row selected"); } 但这仅在用户使用鼠标进行拖放选择时有效。但当用户使用CTRL键选择时,RowSel和Row的值相同。如何区分用户的单个选择和多个选择。我知道这是针对VB的,但它

如何知道用户是否进行了单行选择和多行选择。我使用以下代码:

if(grdSearch.Row==grdSearch.RowSel)
{
    MessageBox.Show("single row selected");
}
else
{
    MessageBox.Show("multiple row selected");
}

但这仅在用户使用鼠标进行拖放选择时有效。但当用户使用CTRL键选择时,RowSel和Row的值相同。如何区分用户的单个选择和多个选择。

我知道这是针对VB的,但它可能会帮助用户搜索类似的东西。 我在列0中有一个布尔列,因此通过允许用户选中每个框,他们将值设置为-1。该脚本循环遍历整个记录集,并从第3列创建一个值字符串,以便将其插入到SQL查询中

Dim list As String = ""

        For Each row As C1.Win.C1FlexGrid.Row In flexgrid.Rows
        If flexgrid.GetData(row.Index, 0) = -1 Then
            If list <> vbNullString Then list = list & ", "
                list = list & "'"
                list = list & flexgrid.GetData(row.Index, 3)
                list = list & "'"
        End If
    Next
Dim list As String=“”
对于flexgrid.Rows中作为C1.Win.C1FlexGrid.row的每一行
如果flexgrid.GetData(row.Index,0)=-1,则
如果list vbNullString,则list=list&“
列表=列表&“”
list=list&flexgrid.GetData(row.Index,3)
列表=列表&“”
如果结束
下一个

可能有用是的,我正在使用类似的功能,找到多个选择和单个选择之间的差异将节省大量循环并提高效率。