protected virtual void OnListViewItemEnterKeyPressed(ListViewGridSelectionEventArgs e)
 {
     if (ListViewItemEnterKeyPressed != null)
     {
         ListViewItemEnterKeyPressed(this, e);
     }
 }
 protected virtual void OnSelectedListItemChanged(ListViewGridSelectionEventArgs e)
 {
     if (SelectedListItemChanged != null)
     {
         SelectedListItemChanged(this, e);
     }
 }
 protected virtual void OnListViewItemDoubleClick(ListViewGridSelectionEventArgs e)
 {
     if (ListViewItemDoubleClick != null)
     {
         ListViewItemDoubleClick(this, e);
     }
 }
        private void ListViewGrid_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (!Redraw)
            {
                return;
            }
            HitTestInfo _test = HitTest(e.Location);
            int         _row = _test.Row; int _col = _test.Column;

            try
            {
                if (_row >= Rows.Fixed &&
                    _row <= (Rows.Count - 1))
                {
                    if (_col >= Cols.Fixed &&
                        _col <= (Cols.Count - 1))
                    {
                        object _userdata = GetUserData(_row, _col);
                        if (!Materia.IsNullOrNothing(_userdata))
                        {
                            if (_userdata is ListViewGridItem)
                            {
                                ListViewGridItem _item = (ListViewGridItem)_userdata;
                                ListViewGridSelectionEventArgs _args = new ListViewGridSelectionEventArgs(_item);
                                OnListViewItemDoubleClick(_args);
                            }
                        }
                    }
                }
            }
            catch { }
        }
        private void ListViewGrid_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == VisualBasic.Chr(13))
            {
                int _row = RowSel; int _col = ColSel;

                try
                {
                    if (_row >= Rows.Fixed &&
                        _row <= (Rows.Count - 1))
                    {
                        if (_col >= Cols.Fixed &&
                            _col <= (Cols.Count - 1))
                        {
                            object _userdata = GetUserData(_row, _col);
                            if (!Materia.IsNullOrNothing(_userdata))
                            {
                                if (_userdata is ListViewGridItem)
                                {
                                    ListViewGridItem _item = (ListViewGridItem)_userdata;
                                    ListViewGridSelectionEventArgs _args = new ListViewGridSelectionEventArgs(_item);
                                    OnListViewItemEnterKeyPressed(_args);
                                }
                            }
                        }
                    }
                }
                catch { }
            }
        }
 private void lstvwRecords_ListViewItemEnterKeyPressed(object sender, ListViewGridSelectionEventArgs e)
 {
     if (e.ListItem != null)
     {
         DevComponents.AdvTree.Node[] _nodes = trvwModules.Nodes.Find(e.ListItem.Name, true);
         if (_nodes.Length > 0)
         {
             DevComponents.AdvTree.Node _selectednode = _nodes[0];
             trvwModules.SelectedNode = _selectednode;
         }
     }
 }
        private void ListViewGrid_BeforeSelChange(object sender, RangeEventArgs e)
        {
            if (!Redraw)
            {
                return;
            }

            try
            {
                int _row = e.NewRange.BottomRow;
                int _col = e.NewRange.RightCol;

                if (_row >= Rows.Fixed &&
                    _row <= (Rows.Count - 1))
                {
                    if (_col >= Cols.Fixed &&
                        _col <= (Cols.Count - 1))
                    {
                        object _userdata = GetUserData(_row, _col);
                        if (Materia.IsNullOrNothing(_userdata))
                        {
                            e.Cancel = true;
                        }
                        else
                        {
                            if (!(_userdata is ListViewGridItem))
                            {
                                e.Cancel = true;
                            }
                            else
                            {
                                _selectedlistitem = (ListViewGridItem)_userdata;
                                ListViewGridSelectionEventArgs _args = new ListViewGridSelectionEventArgs(_selectedlistitem);
                                OnSelectedListItemChanged(_args);
                            }
                        }
                    }
                }
            }
            catch { }
        }