Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewElement.cs / 1 / DataGridViewElement.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms
{
using System;
using System.Drawing;
using System.Diagnostics;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
///
///
/// Identifies an element in the dataGridView (base class for TCell, TBand, TRow, TColumn.
///
public class DataGridViewElement
{
private DataGridViewElementStates state; // enabled frozen readOnly resizable selected visible
private DataGridView dataGridView;
///
///
///
/// Initializes a new instance of the class.
///
///
public DataGridViewElement()
{
this.state = DataGridViewElementStates.Visible;
}
internal DataGridViewElement(DataGridViewElement dgveTemplate)
{
// Selected and Displayed states are not inherited
this.state = dgveTemplate.State & (DataGridViewElementStates.Frozen | DataGridViewElementStates.ReadOnly | DataGridViewElementStates.Resizable | DataGridViewElementStates.ResizableSet | DataGridViewElementStates.Visible);
}
///
[
Browsable(false),
EditorBrowsable(EditorBrowsableState.Advanced)
]
public virtual DataGridViewElementStates State
{
get
{
return this.state;
}
}
internal DataGridViewElementStates StateInternal
{
set
{
this.state = value;
}
}
internal bool StateIncludes(DataGridViewElementStates elementState)
{
return (this.State & elementState) == elementState;
}
internal bool StateExcludes(DataGridViewElementStates elementState)
{
return (this.State & elementState) == 0;
}
///
[
Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public DataGridView DataGridView
{
get
{
return this.dataGridView;
}
}
internal DataGridView DataGridViewInternal
{
set
{
if (this.DataGridView != value)
{
this.dataGridView = value;
OnDataGridViewChanged();
}
}
}
///
protected virtual void OnDataGridViewChanged()
{
}
///
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control
protected void RaiseCellClick(DataGridViewCellEventArgs e)
{
if (this.dataGridView != null)
{
this.dataGridView.OnCellClickInternal(e);
}
}
///
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control
protected void RaiseCellContentClick(DataGridViewCellEventArgs e)
{
if (this.dataGridView != null)
{
this.dataGridView.OnCellContentClickInternal(e);
}
}
///
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control
protected void RaiseCellContentDoubleClick(DataGridViewCellEventArgs e)
{
if (this.dataGridView != null)
{
this.dataGridView.OnCellContentDoubleClickInternal(e);
}
}
///
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control
protected void RaiseCellValueChanged(DataGridViewCellEventArgs e)
{
if (this.dataGridView != null)
{
this.dataGridView.OnCellValueChangedInternal(e);
}
}
///
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control
protected void RaiseDataError(DataGridViewDataErrorEventArgs e)
{
if (this.dataGridView != null)
{
this.dataGridView.OnDataErrorInternal(e);
}
}
///
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control
protected void RaiseMouseWheel(MouseEventArgs e)
{
if (this.dataGridView != null)
{
this.dataGridView.OnMouseWheelInternal(e);
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- _LazyAsyncResult.cs
- Hex.cs
- CodeDefaultValueExpression.cs
- Aes.cs
- SiteOfOriginPart.cs
- HtmlInputText.cs
- PrintDialogException.cs
- CodeDomComponentSerializationService.cs
- Parsers.cs
- IODescriptionAttribute.cs
- UnsafeNativeMethods.cs
- TypeUtils.cs
- ToolStripEditorManager.cs
- ByteStream.cs
- XmlAttribute.cs
- MetadataPropertyCollection.cs
- XPathPatternParser.cs
- Scheduler.cs
- GlobalProxySelection.cs
- XmlWriterSettings.cs
- KeyGestureValueSerializer.cs
- ToolboxComponentsCreatedEventArgs.cs
- ManagementExtension.cs
- StringUtil.cs
- TypeResolvingOptions.cs
- MediaPlayer.cs
- WebPartEditorOkVerb.cs
- IOException.cs
- EntityDataSourceColumn.cs
- NameValuePermission.cs
- ObjectListTitleAttribute.cs
- ArraySegment.cs
- SafeFileMappingHandle.cs
- PersonalizationStateInfo.cs
- SecurityContext.cs
- NumberFormatter.cs
- AssociationSetEnd.cs
- PointLightBase.cs
- EventMetadata.cs
- ConsoleKeyInfo.cs
- XamlPoint3DCollectionSerializer.cs
- GridViewColumnCollection.cs
- Win32NamedPipes.cs
- SID.cs
- AppDomainManager.cs
- Stylesheet.cs
- TokenBasedSetEnumerator.cs
- XmlException.cs
- TransformedBitmap.cs
- RequestCachePolicy.cs
- ping.cs
- ProcessHostMapPath.cs
- SimpleApplicationHost.cs
- CodeBlockBuilder.cs
- HtmlSelect.cs
- ApplicationGesture.cs
- TrackingWorkflowEventArgs.cs
- DataBindingCollectionEditor.cs
- EndpointAddressAugust2004.cs
- Vector3DIndependentAnimationStorage.cs
- DataSet.cs
- FontDialog.cs
- StatusBar.cs
- DbSetClause.cs
- UIElementIsland.cs
- SerializationException.cs
- AQNBuilder.cs
- ItemsControlAutomationPeer.cs
- SharedStatics.cs
- FloaterParaClient.cs
- CollectionViewSource.cs
- DiagnosticStrings.cs
- ContentPlaceHolder.cs
- BindingOperations.cs
- SettingsPropertyCollection.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- CodeTypeParameterCollection.cs
- CodeSnippetCompileUnit.cs
- Timer.cs
- DocumentViewerConstants.cs
- AppSettingsExpressionEditor.cs
- Graphics.cs
- StateElement.cs
- WebContext.cs
- UnsafeNetInfoNativeMethods.cs
- COM2PictureConverter.cs
- Random.cs
- WebBrowserUriTypeConverter.cs
- TextParaClient.cs
- IconBitmapDecoder.cs
- RowUpdatedEventArgs.cs
- StorageAssociationSetMapping.cs
- SqlNode.cs
- LineSegment.cs
- XmlObjectSerializerReadContextComplex.cs
- CfgSemanticTag.cs
- ACE.cs
- DynamicMethod.cs
- TimeSpanValidator.cs
- HierarchicalDataBoundControlAdapter.cs