Example #1
0
        public void validate_powerLevel(object sender, EventArgs e)
        {
            CustomListView.ListViewEx.TextBoxLeaveEventArg te = (CustomListView.ListViewEx.TextBoxLeaveEventArg)e;

            try
            {
                //double pwrLv = byte.Parse(this.listViewEx1.Items[te.Row].SubItems[te.Col].Text);
                double pwrVal;
                double criteriaVal = 200;
                double minPwrLv    = -10d;

                pwrVal = ((Convert.ToDouble(this.listViewEx1.Items[te.Row].SubItems[te.Col].Text)) - criteriaVal) / 10d;
                this.listViewEx1.Items[te.Row].SubItems[3].Text = Convert.ToString(pwrVal);

                double pwrLv = Convert.ToDouble(this.listViewEx1.Items[te.Row].SubItems[te.Col].Text);
                if (pwrLv < minPwrLv)
                {
                    this.listViewEx1.Items[te.Row].SubItems[3].Text = "Invalid  Power";
                }
            }
            catch
            {
                this.listViewEx1.Items[te.Row].SubItems[te.Col].Text = "Invalid Power 2";
            }
        }
        public void validate_channel(object sender, EventArgs e)
        {
            CustomListView.ListViewEx.TextBoxLeaveEventArg te = (CustomListView.ListViewEx.TextBoxLeaveEventArg)e;

            try
            {
                byte ch = byte.Parse(this.listViewEx1.Items[te.Row].SubItems[te.Col].Text);
                if (ch >= SIZE_MAX)
                {
                    this.listViewEx1.Items[te.Row].SubItems[1].Text = "Invalid Channel";
                }
            }
            catch
            {
                this.listViewEx1.Items[te.Row].SubItems[te.Col].Text = "Invalid Channel";
            }
        }