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
- IFlowDocumentViewer.cs
- XPathDocumentNavigator.cs
- BufferModesCollection.cs
- CloseSequence.cs
- DataServiceRequestException.cs
- ParentUndoUnit.cs
- ResourceExpressionBuilder.cs
- XmlNodeChangedEventArgs.cs
- ArgumentsParser.cs
- typedescriptorpermission.cs
- Activity.cs
- ApplicationServiceHelper.cs
- BaseUriWithWildcard.cs
- SQLByte.cs
- WebEvents.cs
- ToolTip.cs
- DetailsViewDeletedEventArgs.cs
- NativeMethods.cs
- XMLUtil.cs
- MetaModel.cs
- Menu.cs
- JoinElimination.cs
- SafePointer.cs
- DocumentSequence.cs
- CollectionViewGroup.cs
- ApplicationServiceHelper.cs
- Psha1DerivedKeyGenerator.cs
- CodeNamespace.cs
- Or.cs
- GridView.cs
- TdsParserHelperClasses.cs
- PointLight.cs
- PenLineJoinValidation.cs
- PKCS1MaskGenerationMethod.cs
- UrlMappingsSection.cs
- TemplateComponentConnector.cs
- EnumerableValidator.cs
- MILUtilities.cs
- XmlSortKey.cs
- WindowsFormsHost.cs
- ElementMarkupObject.cs
- ConfigXmlDocument.cs
- Function.cs
- RequestSecurityToken.cs
- ExtensionDataReader.cs
- ToolStripSplitButton.cs
- SystemIPv4InterfaceProperties.cs
- RegistrationServices.cs
- CqlParser.cs
- SmtpDigestAuthenticationModule.cs
- ServerProtocol.cs
- ApplicationFileParser.cs
- Block.cs
- PropertyTab.cs
- CompilerCollection.cs
- ObjectViewFactory.cs
- TagPrefixAttribute.cs
- FileCodeGroup.cs
- ModifierKeysValueSerializer.cs
- EventListener.cs
- BufferedWebEventProvider.cs
- TailCallAnalyzer.cs
- BindableAttribute.cs
- ItemList.cs
- NonceToken.cs
- BackgroundFormatInfo.cs
- SqlCacheDependency.cs
- StandardCommands.cs
- ObjectParameterCollection.cs
- ProviderCollection.cs
- DoubleLinkListEnumerator.cs
- DrawingGroup.cs
- SvcMapFileSerializer.cs
- TypeConverterHelper.cs
- AdRotator.cs
- TransportSecurityProtocol.cs
- Int64Animation.cs
- NonClientArea.cs
- ValidatorCollection.cs
- FormViewPagerRow.cs
- TypePresenter.xaml.cs
- TextServicesContext.cs
- WeakReferenceKey.cs
- HtmlInputHidden.cs
- EntityCommandExecutionException.cs
- Int32Animation.cs
- InProcStateClientManager.cs
- DataTableTypeConverter.cs
- GraphicsState.cs
- OleDbCommand.cs
- ExplicitDiscriminatorMap.cs
- InlinedLocationReference.cs
- EdgeModeValidation.cs
- XamlFigureLengthSerializer.cs
- AnnotationService.cs
- Bitmap.cs
- XamlTemplateSerializer.cs
- SemanticResultKey.cs
- XmlSerializationWriter.cs
- XPathException.cs