Example #1
0
        }//-------------------------

        //#############################################END PICTUREBOX pbxDone EVENTS##############################################################

        //####################################################DATAGRIDVIEW dgvList EVENTS####################################################
        //event is raised when the mouse is enter
        private void dgvListCellEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0)
            {
                this.dgvList.BeginEdit(true);

                //DD Code July 20, 2010
                //Int16 slots;
                //if ((!String.Equals(this.dgvList[6, e.RowIndex].Value.ToString(), "0")) &&
                //    (Int16.TryParse((this.dgvList[6, e.RowIndex].Value).ToString(), out slots) && slots >= 0))

                //AD code July 20, 2010.. Added Code to get no slots available
                if (_studentManager.IsNoHasSlotsAvailable((this.dgvList[1, e.RowIndex].Value).ToString()))
                {
                    this.dgvList[0, e.RowIndex].ReadOnly = true;
                }
                else
                {
                    this.dgvList[0, e.RowIndex].ReadOnly = false;
                }

                DataGridViewCell dgvCell = this.dgvList.Rows[e.RowIndex].Cells["sysid_schedule"];

                dgvCell.ErrorText = String.Empty;

                String strTemp = String.Empty;

                if (_studentManager.HasConflictSchedule((System.Data.DataTable) this.dgvList.DataSource,
                                                        this.dgvList.Rows[e.RowIndex].Cells["sysid_schedule"].Value.ToString(), ref strTemp))
                {
                    this.dgvList[0, e.RowIndex].ReadOnly = true;
                    this.dgvList.ShowRowErrors           = true;
                }
                else
                {
                    this.dgvList[0, e.RowIndex].ReadOnly = false;
                }

                this.dgvList.EndEdit();
            }
            else
            {
                this.dgvList.Rows[e.RowIndex].ReadOnly = true;
            }
        }//---------------------------