protected virtual void OnItemSubItemClick(ItemSubItemClickEventArgs e) { if (this.ItemSubItemClick != null) { ItemSubItemClick(this, e); } }
private void ListView_SubItemHitTest(MouseEventsTypes met) { LVHITTESTINFO lvh = new LVHITTESTINFO(); lvh.pt = PointToClient(Control.MousePosition); IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(lvh)); Marshal.StructureToPtr(lvh, ptr, true); SendMessage(Handle, LVM_SUBITEMHITTEST, IntPtr.Zero, ptr); lvh = (LVHITTESTINFO)Marshal.PtrToStructure(ptr, typeof(LVHITTESTINFO)); Marshal.FreeHGlobal(ptr); // check if the item is valid if ((lvh.iItem >= 0) || (lvh.iSubItem >= 0)) { ItemSubItemClickEventArgs args = new ItemSubItemClickEventArgs(lvh.iItem, lvh.iSubItem, met); this.OnItemSubItemClick(args); } else { this.Cursor = Cursors.Default; } }
protected virtual void OnItemSubItemClick(ItemSubItemClickEventArgs e) { if (this.ItemSubItemClick != null) { ItemSubItemClick(this, e); } }
private void ListView_SubItemHitTest(MouseEventsTypes met) { LVHITTESTINFO lvh = new LVHITTESTINFO(); lvh.pt = PointToClient(Control.MousePosition); IntPtr ptr = Marshal.AllocHGlobal( Marshal.SizeOf(lvh) ); Marshal.StructureToPtr(lvh, ptr, true); SendMessage(Handle, LVM_SUBITEMHITTEST, IntPtr.Zero, ptr); lvh = (LVHITTESTINFO)Marshal.PtrToStructure(ptr, typeof(LVHITTESTINFO)); Marshal.FreeHGlobal(ptr); // check if the item is valid if ((lvh.iItem >= 0) || (lvh.iSubItem >= 0)) { ItemSubItemClickEventArgs args = new ItemSubItemClickEventArgs(lvh.iItem, lvh.iSubItem, met); this.OnItemSubItemClick(args); } else this.Cursor = Cursors.Default; }
private void lstVwPaginated_ItemSubItemClick(object sender, ItemSubItemClickEventArgs e) { this.lstVwPaginated.Cursor = Cursors.Default; if (e.ItemIndex < 0) return; ListViewItem item = lstVwPaginated.Items[e.ItemIndex]; if (lstVwPaginated.SelectedItems.Contains(item) && PermissoesHelper.CanChangePermission(item, e.SubItemIndex) && e.MouseEvent == PxListView.MouseEventsTypes.MouseDown) PermissoesHelper.ChangePermission(CurrentTrusteeRow, (GISADataset.NivelRow)item.Tag, item, e.SubItemIndex); else { if (PermissoesHelper.CanChangePermission(item, e.SubItemIndex) && e.MouseEvent == PxListView.MouseEventsTypes.MouseMove) this.lstVwPaginated.Cursor = Cursors.Hand; else this.lstVwPaginated.Cursor = Cursors.Default; } }
private void lstVwPaginated_ItemSubItemClick(object sender, ItemSubItemClickEventArgs e) { if (e.SubItemIndex < 0 || e.ItemIndex < 0) return; ListViewItem item = lstVwPaginated.Items[e.ItemIndex]; if (lstVwPaginated.SelectedItems.Contains(item) && (e.SubItemIndex > 0) && e.MouseEvent == PxListView.MouseEventsTypes.MouseDown && item.SubItems[e.SubItemIndex].Tag != null) PermissoesHelper.ChangeODPermission(CurrentTrusteeRow, CurrentNivelRow, item, e.SubItemIndex); else { if ((e.SubItemIndex > 0) && e.MouseEvent == PxListView.MouseEventsTypes.MouseMove && item.SubItems[e.SubItemIndex].Tag != null) this.lstVwPaginated.Cursor = Cursors.Hand; else this.lstVwPaginated.Cursor = Cursors.Default; } }
private void PxListView_ItemSubItemClick(object sender, ItemSubItemClickEventArgs e) { if (e.SubItemIndex < 0 || e.ItemIndex < 0) return; ListViewItem item = lstvwPermissoes.Items[e.ItemIndex]; if (lstvwPermissoes.SelectedItems.Contains(item) && (e.SubItemIndex > 0) && CanChangePermission(item, e.SubItemIndex) && e.MouseEvent == PxListView.MouseEventsTypes.MouseDown) ChangePermission(CurrentTrusteeRow, item, e.SubItemIndex); else { if ((e.SubItemIndex > 0) && CanChangePermission(item, e.SubItemIndex) && e.MouseEvent == PxListView.MouseEventsTypes.MouseMove) this.lstvwPermissoes.Cursor = Cursors.Hand; else this.lstvwPermissoes.Cursor = Cursors.Default; } }