Exemple #1
0
        /// <summary>
        /// Raises the SelectionChanged event
        /// </summary>
        /// <param name="e">A SelectionEventArgs that contains the event data</param>
        protected virtual void OnSelectionChanged(SelectionEventArgs e)
        {
            if (this.CanRaiseEvents)
            {
                if (this.Table != null)
                {
                    this.Table.OnSelectionChanged(e);
                }

                if (SelectionChanged != null)
                {
                    SelectionChanged(this, e);
                }
            }
        }
Exemple #2
0
		/// <summary>
		/// Raises the SelectionChanged event
		/// </summary>
		/// <param name="e">A TableModelEventArgs that contains the event data</param>
		protected internal virtual void OnSelectionChanged(SelectionEventArgs e)
		{
			if (this.CanRaiseEvents)
			{
				if (e.OldSelectionBounds != Rectangle.Empty)
				{
					Rectangle invalidateRect = new Rectangle(this.DisplayRectToClient(e.OldSelectionBounds.Location), e.OldSelectionBounds.Size);

					if (this.HeaderStyle != ColumnHeaderStyle.None)
					{
						invalidateRect.Y += this.HeaderHeight;
					}
					
					this.Invalidate(invalidateRect);
				} 

				if (e.NewSelectionBounds != Rectangle.Empty)
				{
					Rectangle invalidateRect = new Rectangle(this.DisplayRectToClient(e.NewSelectionBounds.Location), e.NewSelectionBounds.Size);

					if (this.HeaderStyle != ColumnHeaderStyle.None)
					{
						invalidateRect.Y += this.HeaderHeight;
					}
					
					this.Invalidate(invalidateRect);
				}
				
				if (SelectionChanged != null)
				{
					SelectionChanged(this, e);
				}
			}
		}
 private void lvwLeaveSchedule_SelectionChanged(object sender, SelectionEventArgs e)
 {
     if (e.NewSelectedIndicies.Length > 0)
     {
         selectedRowIndex = (int)lvwLeaveSchedule.TableModel.Rows[e.NewSelectedIndicies[0]].Tag;
     }
 }
			/// <summary>
			/// 
			/// </summary>
			/// <param name="sender"></param>
			/// <param name="e"></param>
			private void columnTable_SelectionChanged(object sender, SelectionEventArgs e)
			{
				if (e.OldSelectedIndicies.Length > 0)
				{
					if (this.widthTextBox.Text.Length == 0)
					{
						this.columnTable.TableModel[e.OldSelectedIndicies[0], 0].Tag = Column.MinimumWidth;
					}
					else
					{
						int width = Convert.ToInt32(this.widthTextBox.Text);

						if (width < Column.MinimumWidth)
						{
							this.columnTable.TableModel[e.OldSelectedIndicies[0], 0].Tag = Column.MinimumWidth;
						}
						else
						{
							this.columnTable.TableModel[e.OldSelectedIndicies[0], 0].Tag = width;
						}
					}
				}
				
				if (e.NewSelectedIndicies.Length > 0)
				{
					this.showButton.Enabled = !this.columnTable.TableModel[e.NewSelectedIndicies[0], 0].Checked;
					this.hideButton.Enabled = this.columnTable.TableModel[e.NewSelectedIndicies[0], 0].Checked;

					this.widthTextBox.Text = this.columnTable.TableModel[e.NewSelectedIndicies[0], 0].Tag.ToString();
				}
				else
				{
					this.showButton.Enabled = false;
					this.hideButton.Enabled = false;

					this.widthTextBox.Text = "0";
				}
			}
Exemple #5
0
 private void lvwListPunish_SelectionChanged(object sender, SelectionEventArgs e)
 {
     if(e.NewSelectedIndicies.Length > 0)//có ít nhất một hàng được chọn
     {
         // lấy ra vị trí của hàng đuợc chọn, NewSelectedIndicies[0]= chỉ chọn một hàng
         selectedRowIndex  = (int)lvwListPunish.TableModel.Rows[e.NewSelectedIndicies[0]].Tag;
     }
 }
Exemple #6
0
 private void lvwShift_SelectionChanged(object sender, SelectionEventArgs e)
 {
     if (e.NewSelectedIndicies.Length > 0)
     {
         selectedRow = (int)lvwShift.TableModel.Rows[e.NewSelectedIndicies[0]].Tag;
     }
 }