コード例 #1
0
 private void gridViewEmployee_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     if (gridViewEmployee.FocusedRowHandle > -1)
     {
         bool flag = Selection1.IsRowSelected(gridViewEmployee.FocusedRowHandle);
         Selection1.SelectRow(gridViewEmployee.FocusedRowHandle, !flag);
     }
 }
コード例 #2
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            WhereClauseListEmployee = "";
            WhereClauseListRefNo    = "";

            if (radioVoucher.Checked)
            {
                if (grdVoucher.DataSource != null && grdViewVoucher.RowCount > 0)
                {
                    for (var i = 0; i < grdViewVoucher.RowCount; i++)
                    {
                        if (Selection2.IsRowSelected(i))
                        {
                            var row = (SalaryVoucherModel)grdViewVoucher.GetRow(i);
                            WhereClauseListRefNo = WhereClauseListRefNo + "'" + row.RefNo + "',";
                        }
                    }
                }
            }
            else
            {
                if (grdEmployee.DataSource != null && gridViewEmployee.RowCount > 0)
                {
                    for (var i = 0; i < gridViewEmployee.RowCount; i++)
                    {
                        if (Selection1.IsRowSelected(i))
                        {
                            var row = (EmployeeModel)gridViewEmployee.GetRow(i);
                            WhereClauseListEmployee = WhereClauseListEmployee + row.EmployeeId + ",";
                        }
                    }
                }
            }

            if (WhereClauseListEmployee != "")
            {
                WhereClauseListEmployee = WhereClauseListEmployee.Substring(0, WhereClauseListEmployee.Length - 1);
            }

            if (WhereClauseListRefNo != "")
            {
                WhereClauseListRefNo = WhereClauseListRefNo.Substring(0, WhereClauseListRefNo.Length - 1);
                //  WhereClauseListRefNo = WhereClauseListRefNo
            }
        }