コード例 #1
0
        }//----------------------

        //####################################################END DATAGRIDVIEW dgvList EVENTS####################################################

        //##################################TEXTBOX txtSearch EVENTS##########################################################
        //event is raised when the key is up
        protected override void txtSearchKeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;

                    this.SetDataGridViewSource(_studentManager.GetSearchedSubjectInformation(((TextBox)sender).Text));

                    this.SelectFirstRowInDataGridView();

                    for (Int32 x = 0; x < this.dgvList.Rows.Count; x++)
                    {
                        //DD Cod July 20, 2010
                        //if ((String.Equals(this.dgvList[6, x].Value.ToString(), "0")) ||
                        //    (Int16.TryParse((this.dgvList[6, x].Value).ToString(), out slots) && slots <= 0))


                        //AD code July 20, 2010.. Added Code to get no slots available
                        if (_studentManager.IsNoHasSlotsAvailable((this.dgvList[1, x].Value).ToString()))
                        {
                            this.dgvList[0, x].ReadOnly = true;
                        }
                        else
                        {
                            this.dgvList[0, x].ReadOnly = false;
                        }
                    }
                }
                catch (Exception ex)
                {
                    RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Retrieving Student List");
                }
                finally
                {
                    this.Cursor = Cursors.Arrow;
                }
            }

            base.txtSearchKeyUp(sender, e);
        }//--------------------