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
- SHA256Cng.cs
- SafeCloseHandleCritical.cs
- TextElementCollection.cs
- XmlSchemaSimpleContentExtension.cs
- SqlUtils.cs
- RemoteWebConfigurationHost.cs
- ReservationCollection.cs
- Misc.cs
- CheckBoxAutomationPeer.cs
- IIS7UserPrincipal.cs
- LongTypeConverter.cs
- HandleCollector.cs
- CodeCommentStatement.cs
- RectAnimationClockResource.cs
- ComplexType.cs
- ContentPresenter.cs
- UnsafeCollabNativeMethods.cs
- HostExecutionContextManager.cs
- PreApplicationStartMethodAttribute.cs
- ModuleConfigurationInfo.cs
- FormViewPagerRow.cs
- NegotiationTokenProvider.cs
- Debug.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ModifierKeysValueSerializer.cs
- FacetValueContainer.cs
- DependencyObjectPropertyDescriptor.cs
- XhtmlBasicTextViewAdapter.cs
- PartialTrustVisibleAssembly.cs
- PolicyDesigner.cs
- BehaviorService.cs
- Helper.cs
- XPathBuilder.cs
- DataSysAttribute.cs
- ProcessModelSection.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- AtomServiceDocumentSerializer.cs
- ActivityXRefPropertyEditor.cs
- UrlPath.cs
- Util.cs
- DbConnectionStringCommon.cs
- InternalConfigEventArgs.cs
- StylusOverProperty.cs
- StructuredTypeEmitter.cs
- OleDbError.cs
- TTSEvent.cs
- oledbconnectionstring.cs
- CompressEmulationStream.cs
- ConfigurationStrings.cs
- CollectionBase.cs
- ObjectDataSourceEventArgs.cs
- StrokeFIndices.cs
- ResourceIDHelper.cs
- GridProviderWrapper.cs
- PropertyGeneratedEventArgs.cs
- GregorianCalendarHelper.cs
- ObjectDataSource.cs
- ExportOptions.cs
- XsltCompileContext.cs
- Graphics.cs
- FontStretchConverter.cs
- FileLoadException.cs
- Camera.cs
- QueryStringHandler.cs
- TokenBasedSetEnumerator.cs
- EdmSchemaAttribute.cs
- XmlSchemaComplexType.cs
- XmlSchemaExporter.cs
- SmtpNegotiateAuthenticationModule.cs
- RSAOAEPKeyExchangeFormatter.cs
- LogSwitch.cs
- X509Chain.cs
- SqlStream.cs
- DataRecordInternal.cs
- MorphHelpers.cs
- TableCellAutomationPeer.cs
- Opcode.cs
- EditingCommands.cs
- ComplexTypeEmitter.cs
- HttpRequestTraceRecord.cs
- PointAnimationBase.cs
- LineVisual.cs
- DbUpdateCommandTree.cs
- DataGridParentRows.cs
- UnaryNode.cs
- CompressEmulationStream.cs
- ParseElement.cs
- OleDbFactory.cs
- AuthorizationRuleCollection.cs
- PeoplePickerWrapper.cs
- ConfigurationManagerHelperFactory.cs
- Configuration.cs
- XmlElementAttribute.cs
- TextCharacters.cs
- _AuthenticationState.cs
- TableRowCollection.cs
- InputLangChangeEvent.cs
- ServiceNotStartedException.cs
- TextSerializer.cs
- Calendar.cs