Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / DataGridLinkButton.cs / 2 / DataGridLinkButton.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.Drawing; using System.Web.Util; ////// Derived version of LinkButton used within a DataGrid. /// [SupportsEventValidation] internal sealed class DataGridLinkButton : LinkButton { internal DataGridLinkButton() {} protected internal override void Render(HtmlTextWriter writer) { SetForeColor(); base.Render(writer); } ////// In HTML hyperlinks always use the browser's link color. /// For the DataGrid, we want all LinkButtons to honor the ForeColor setting. /// This requires looking up into the control hierarchy to see if either the cell /// or the containing row or table define a ForeColor. /// private void SetForeColor() { if (ControlStyle.IsSet(System.Web.UI.WebControls.Style.PROP_FORECOLOR) == false) { Color hyperLinkForeColor; Control control = this; for (int i = 0; i < 3; i++) { control = control.Parent; Debug.Assert(((i == 0) && (control is TableCell)) || ((i == 1) && (control is TableRow)) || ((i == 2) && (control is Table))); hyperLinkForeColor = ((WebControl)control).ForeColor; if (hyperLinkForeColor != Color.Empty) { ForeColor = hyperLinkForeColor; break; } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.Drawing; using System.Web.Util; ////// Derived version of LinkButton used within a DataGrid. /// [SupportsEventValidation] internal sealed class DataGridLinkButton : LinkButton { internal DataGridLinkButton() {} protected internal override void Render(HtmlTextWriter writer) { SetForeColor(); base.Render(writer); } ////// In HTML hyperlinks always use the browser's link color. /// For the DataGrid, we want all LinkButtons to honor the ForeColor setting. /// This requires looking up into the control hierarchy to see if either the cell /// or the containing row or table define a ForeColor. /// private void SetForeColor() { if (ControlStyle.IsSet(System.Web.UI.WebControls.Style.PROP_FORECOLOR) == false) { Color hyperLinkForeColor; Control control = this; for (int i = 0; i < 3; i++) { control = control.Parent; Debug.Assert(((i == 0) && (control is TableCell)) || ((i == 1) && (control is TableRow)) || ((i == 2) && (control is Table))); hyperLinkForeColor = ((WebControl)control).ForeColor; if (hyperLinkForeColor != Color.Empty) { ForeColor = hyperLinkForeColor; break; } } } } } } // 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
- ApplicationDirectory.cs
- QilTargetType.cs
- GridToolTip.cs
- Label.cs
- SystemWebCachingSectionGroup.cs
- EntityModelSchemaGenerator.cs
- XmlExpressionDumper.cs
- RightsManagementEncryptionTransform.cs
- NativeMethods.cs
- __TransparentProxy.cs
- BitmapCodecInfoInternal.cs
- SelectionEditor.cs
- BuildProviderCollection.cs
- InvalidFilterCriteriaException.cs
- VerificationException.cs
- MsmqSecureHashAlgorithm.cs
- CharAnimationBase.cs
- ValidatorCompatibilityHelper.cs
- StringUtil.cs
- DocumentApplicationJournalEntry.cs
- ProfileBuildProvider.cs
- GenericAuthenticationEventArgs.cs
- Timer.cs
- PropertyGroupDescription.cs
- OdbcPermission.cs
- BitmapEncoder.cs
- BitmapFrameEncode.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- BindUriHelper.cs
- XPathScanner.cs
- MouseButtonEventArgs.cs
- CompilationSection.cs
- AmbientProperties.cs
- GridViewSelectEventArgs.cs
- TextInfo.cs
- XPathScanner.cs
- ChannelSinkStacks.cs
- UnhandledExceptionEventArgs.cs
- BitmapSource.cs
- OutputCacheProfileCollection.cs
- HttpRequestMessageProperty.cs
- ProcessModuleDesigner.cs
- SimpleTextLine.cs
- RelatedEnd.cs
- ContractValidationHelper.cs
- SqlRemoveConstantOrderBy.cs
- EntityDesignerUtils.cs
- DriveNotFoundException.cs
- ServiceDescriptionImporter.cs
- AxImporter.cs
- FilteredSchemaElementLookUpTable.cs
- Soap.cs
- TextBox.cs
- XmlElementAttributes.cs
- XmlSequenceWriter.cs
- SoapAttributeAttribute.cs
- SerializerProvider.cs
- DataTableExtensions.cs
- InternalException.cs
- TextRunTypographyProperties.cs
- HttpAsyncResult.cs
- BasePropertyDescriptor.cs
- ControlPropertyNameConverter.cs
- ColumnMapProcessor.cs
- Exceptions.cs
- WebBrowserEvent.cs
- _SSPIWrapper.cs
- Style.cs
- CqlLexerHelpers.cs
- MimeParameterWriter.cs
- X509Utils.cs
- CookielessData.cs
- RightsManagementPermission.cs
- DispatcherEventArgs.cs
- StylusPointPropertyUnit.cs
- PolicyDesigner.cs
- XamlGridLengthSerializer.cs
- IEnumerable.cs
- OptimisticConcurrencyException.cs
- ButtonBaseAdapter.cs
- WinFormsSecurity.cs
- PerformanceCounterPermission.cs
- XAMLParseException.cs
- MemberAccessException.cs
- PeerName.cs
- LinkButton.cs
- TemplateInstanceAttribute.cs
- DoubleUtil.cs
- AsyncOperationContext.cs
- WebHttpSecurity.cs
- SerializationObjectManager.cs
- ConnectionManagementElement.cs
- EntityDataSourceQueryBuilder.cs
- WebPartTracker.cs
- DeclarativeCatalogPart.cs
- StyleCollectionEditor.cs
- ServiceProviders.cs
- SystemResourceKey.cs
- RegexWriter.cs
- MessageQueueTransaction.cs