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; ////// /// public class DataGridViewElement { private DataGridViewElementStates state; // enabled frozen readOnly resizable selected visible private DataGridView dataGridView; ///Identifies an element in the dataGridView (base class for TCell, TBand, TRow, TColumn. ////// /// 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); } ////// Initializes a new instance of the ///class. /// [ 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
- XmlDataSourceView.cs
- RequestCache.cs
- VersionedStreamOwner.cs
- DynamicDocumentPaginator.cs
- RootBrowserWindow.cs
- Stroke.cs
- Math.cs
- DataContractAttribute.cs
- WebRequest.cs
- OdbcConnectionStringbuilder.cs
- TypeToken.cs
- EncoderParameter.cs
- TextSimpleMarkerProperties.cs
- WSFederationHttpBindingElement.cs
- EditorAttribute.cs
- XmlTextAttribute.cs
- BamlWriter.cs
- TaiwanCalendar.cs
- WebPartConnectionsCloseVerb.cs
- log.cs
- BitmapEffectOutputConnector.cs
- Sorting.cs
- ObjectListItem.cs
- Subtree.cs
- MemoryFailPoint.cs
- UriTemplateLiteralQueryValue.cs
- DataGridViewColumnTypeEditor.cs
- ReferencedCollectionType.cs
- BasicKeyConstraint.cs
- GridViewRowCollection.cs
- WebPartEditorOkVerb.cs
- XmlImplementation.cs
- FlowDocumentView.cs
- PeerNearMe.cs
- diagnosticsswitches.cs
- EdmValidator.cs
- XPathParser.cs
- WebRequest.cs
- StringConverter.cs
- ParserContext.cs
- DocumentXmlWriter.cs
- StyleCollectionEditor.cs
- SecuritySessionSecurityTokenAuthenticator.cs
- XsltContext.cs
- RegistryExceptionHelper.cs
- EntityProviderFactory.cs
- ConnectionManagementSection.cs
- ControlsConfig.cs
- SettingsAttributes.cs
- DmlSqlGenerator.cs
- EntityCodeGenerator.cs
- BaseTemplateBuildProvider.cs
- SqlInternalConnectionSmi.cs
- SqlCacheDependencyDatabaseCollection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- TrayIconDesigner.cs
- SemanticKeyElement.cs
- EndOfStreamException.cs
- UseAttributeSetsAction.cs
- Transform3DGroup.cs
- MulticastOption.cs
- SourceLineInfo.cs
- ComponentChangedEvent.cs
- DataGridViewElement.cs
- AccessDataSource.cs
- FixUpCollection.cs
- SchemaSetCompiler.cs
- DbMetaDataColumnNames.cs
- StylusShape.cs
- Single.cs
- ConfigurationManagerHelperFactory.cs
- WebZoneDesigner.cs
- HttpListenerElement.cs
- BypassElement.cs
- DrawingContextWalker.cs
- activationcontext.cs
- ReadOnlyCollection.cs
- BinaryConverter.cs
- EventWaitHandle.cs
- NullToBooleanConverter.cs
- PageEventArgs.cs
- FrugalMap.cs
- XPathDocumentBuilder.cs
- BitmapMetadataEnumerator.cs
- SecureEnvironment.cs
- _SecureChannel.cs
- X509Certificate2Collection.cs
- CustomSignedXml.cs
- BulletChrome.cs
- MLangCodePageEncoding.cs
- Axis.cs
- ToolConsole.cs
- ConstructorExpr.cs
- AdornerPresentationContext.cs
- TextFindEngine.cs
- ConfigurationException.cs
- Int16AnimationBase.cs
- ModuleBuilderData.cs
- FontNameConverter.cs
- AttachmentService.cs