Exemplo n.º 1
0
		protected virtual void OnRowHeightInfoNeeded (DataGridViewRowHeightInfoNeededEventArgs e)
		{
			DataGridViewRowHeightInfoNeededEventHandler eh = (DataGridViewRowHeightInfoNeededEventHandler)(Events [RowHeightInfoNeededEvent]);
			if (eh != null) eh (this, e);
		}
Exemplo n.º 2
0
 void FilterGridView_RowHeightInfoNeeded(object sender, DataGridViewRowHeightInfoNeededEventArgs e)
 {
     e.Height = _lineHeight;
 }
Exemplo n.º 3
0
		public void UpdateRowHeightInfo (int rowIndex, bool updateToEnd)
		{
			if (rowIndex < 0 && updateToEnd)
				throw new ArgumentOutOfRangeException ("rowIndex");
			if (rowIndex < -1 && !updateToEnd)
				throw new ArgumentOutOfRangeException ("rowIndex");
			if (rowIndex >= Rows.Count)
				throw new ArgumentOutOfRangeException ("rowIndex");
			
			if (!VirtualMode && DataManager == null)
				return;

			if (rowIndex == -1) {
				updateToEnd = true;
				rowIndex = 0;
			}

			if (updateToEnd) {
				for (int i = rowIndex; i < Rows.Count; i++) {
					DataGridViewRow row = Rows[i];
					if (!row.Visible)
						continue;

					DataGridViewRowHeightInfoNeededEventArgs rowInfo = 
						new DataGridViewRowHeightInfoNeededEventArgs (row.Index, row.Height, row.MinimumHeight);
					OnRowHeightInfoNeeded (rowInfo);

					if (row.Height != rowInfo.Height || row.MinimumHeight != rowInfo.MinimumHeight) {
						row.Height = rowInfo.Height;
						row.MinimumHeight = rowInfo.MinimumHeight;
						OnRowHeightInfoPushed (new DataGridViewRowHeightInfoPushedEventArgs (row.Index, rowInfo.Height, 
														     rowInfo.MinimumHeight));
					}
				}
			} else {
				DataGridViewRow row = Rows[rowIndex];
				DataGridViewRowHeightInfoNeededEventArgs rowInfo = 
					new DataGridViewRowHeightInfoNeededEventArgs (row.Index, row.Height, row.MinimumHeight);
				OnRowHeightInfoNeeded (rowInfo);

				if (row.Height != rowInfo.Height || row.MinimumHeight != rowInfo.MinimumHeight) {
					row.Height = rowInfo.Height;
					row.MinimumHeight = rowInfo.MinimumHeight;
					OnRowHeightInfoPushed (new DataGridViewRowHeightInfoPushedEventArgs (row.Index, rowInfo.Height, 
													     rowInfo.MinimumHeight));
				}
			}
		}
 protected override void OnRowHeightInfoNeeded(DataGridViewRowHeightInfoNeededEventArgs e)
 {
     e.Height = 26;
     base.OnRowHeightInfoNeeded(e);
 }
Exemplo n.º 5
0
 void DataGridView_RowHeightInfoNeeded(object sender, DataGridViewRowHeightInfoNeededEventArgs e)
 {
     e.Height = GetRowHeight(e.RowIndex);
 }
Exemplo n.º 6
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Set the height of the row when it's requested.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected override void OnRowHeightInfoNeeded(DataGridViewRowHeightInfoNeededEventArgs e)
		{
			e.Height = m_rowHeight;
			e.MinimumHeight = m_rowHeight;
			base.OnRowHeightInfoNeeded(e);
		}
 /// <include file='doc\DataGridView.uex' path='docs/doc[@for="DataGridView.OnRowHeightInfoNeeded"]/*' />
 protected virtual void OnRowHeightInfoNeeded(DataGridViewRowHeightInfoNeededEventArgs e)
 {
     DataGridViewRowHeightInfoNeededEventHandler eh = this.Events[EVENT_DATAGRIDVIEWROWHEIGHTINFONEEDED] as DataGridViewRowHeightInfoNeededEventHandler;
     if (eh != null && !this.dataGridViewOper[DATAGRIDVIEWOPER_inDispose] && !this.IsDisposed)
     {
         eh(this, e);
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Handles the RowHeightInfoNeeded event of the <see cref="DataGridView"/>.
 /// </summary>
 private void DtgLogMessagesRowHeightInfoNeeded(object sender, DataGridViewRowHeightInfoNeededEventArgs e)
 {
     if (mRowHeight > 2)
       {
     e.MinimumHeight = mRowHeight;
     e.Height        = mRowHeight;
       }
 }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// datagridviewrowheightinfoneededeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this DataGridViewRowHeightInfoNeededEventHandler datagridviewrowheightinfoneededeventhandler, Object sender, DataGridViewRowHeightInfoNeededEventArgs e, AsyncCallback callback)
        {
            if(datagridviewrowheightinfoneededeventhandler == null) throw new ArgumentNullException("datagridviewrowheightinfoneededeventhandler");

            return datagridviewrowheightinfoneededeventhandler.BeginInvoke(sender, e, callback, null);
        }
 protected virtual void OnRowHeightInfoNeeded(DataGridViewRowHeightInfoNeededEventArgs e);
Exemplo n.º 11
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handles the RowHeightInfoNeeded event of the gridCharInventory and gridContext grids.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">
		/// The <see cref="T:System.Windows.Forms.DataGridViewRowHeightInfoNeededEventArgs"/>
		/// instance containing the event data.</param>
		/// ------------------------------------------------------------------------------------
		private void HandleRowHeightInfoNeeded(object sender, DataGridViewRowHeightInfoNeededEventArgs e)
		{
			e.Height = m_gridRowHeight;
		}
			protected override void OnRowHeightInfoNeeded (DataGridViewRowHeightInfoNeededEventArgs e)
			{
				base.OnRowHeightInfoNeeded (e);
				RowInfo = new RowInfo (e);
			}
			public RowInfo (DataGridViewRowHeightInfoNeededEventArgs e)
			{
				Height = e.Height;
				MinimumHeight = e.MinimumHeight;
			}
Exemplo n.º 14
0
		private void UpdateRowHeightInfo (DataGridViewRow row)
		{
			DataGridViewRowHeightInfoNeededEventArgs rowInfo =
				new DataGridViewRowHeightInfoNeededEventArgs (row.Index, row.Height, row.MinimumHeight);
			OnRowHeightInfoNeeded (rowInfo);

			if (row.Height != rowInfo.Height || row.MinimumHeight != rowInfo.MinimumHeight) {
				row.MinimumHeight = rowInfo.MinimumHeight;
				row.Height = rowInfo.Height;
				OnRowHeightInfoPushed (new DataGridViewRowHeightInfoPushedEventArgs (row.Index, rowInfo.Height,
													rowInfo.MinimumHeight));
			}
		}