Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / DataGridLinkButton.cs / 1 / 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;
}
}
}
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridPagingPage.cs
- ProfilePropertySettings.cs
- XmlAttributeOverrides.cs
- DesignerCategoryAttribute.cs
- XsltArgumentList.cs
- TagPrefixInfo.cs
- filewebrequest.cs
- InputGestureCollection.cs
- XPathNode.cs
- FormsAuthenticationTicket.cs
- DefaultBinder.cs
- IDispatchConstantAttribute.cs
- CollectionViewGroupRoot.cs
- PrintPreviewGraphics.cs
- SessionEndedEventArgs.cs
- BooleanSwitch.cs
- Listbox.cs
- PointLightBase.cs
- DataGridCellAutomationPeer.cs
- Resources.Designer.cs
- DataGridDetailsPresenterAutomationPeer.cs
- D3DImage.cs
- ExtentJoinTreeNode.cs
- TimeSpanFormat.cs
- OleAutBinder.cs
- RepeaterDesigner.cs
- X509ClientCertificateAuthentication.cs
- complextypematerializer.cs
- SuppressMessageAttribute.cs
- XmlSignificantWhitespace.cs
- FirewallWrapper.cs
- Part.cs
- TextTabProperties.cs
- ExeConfigurationFileMap.cs
- CompositionDesigner.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- WasEndpointConfigContainer.cs
- NavigationProperty.cs
- MailMessageEventArgs.cs
- ContentFileHelper.cs
- TabletDevice.cs
- SystemThemeKey.cs
- DBParameter.cs
- ContainerUtilities.cs
- DataGridState.cs
- MsdtcClusterUtils.cs
- WebServiceResponseDesigner.cs
- KeyBinding.cs
- XamlTemplateSerializer.cs
- GridViewPageEventArgs.cs
- PasswordBox.cs
- MultilineStringConverter.cs
- DataSetMappper.cs
- CompositeFontFamily.cs
- DataTablePropertyDescriptor.cs
- ColumnMapVisitor.cs
- RuleValidation.cs
- InvokeProviderWrapper.cs
- OpenTypeCommon.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DbParameterCollectionHelper.cs
- MatrixKeyFrameCollection.cs
- FastEncoder.cs
- PropertyMetadata.cs
- SqlFlattener.cs
- NTAccount.cs
- InkCollectionBehavior.cs
- ConnectionPoolManager.cs
- DataObjectCopyingEventArgs.cs
- IncrementalReadDecoders.cs
- WSSecurityPolicy12.cs
- MimeImporter.cs
- ImportOptions.cs
- ServiceModelTimeSpanValidator.cs
- HashCodeCombiner.cs
- FunctionMappingTranslator.cs
- ToolStripArrowRenderEventArgs.cs
- RuleSettingsCollection.cs
- UriParserTemplates.cs
- Odbc32.cs
- Schema.cs
- ToolstripProfessionalRenderer.cs
- NameNode.cs
- LineInfo.cs
- InvalidEnumArgumentException.cs
- HtmlShim.cs
- GeometryHitTestResult.cs
- httpserverutility.cs
- MatrixStack.cs
- RenderContext.cs
- UdpContractFilterBehavior.cs
- HttpClientCertificate.cs
- ModifierKeysConverter.cs
- DataGridViewImageColumn.cs
- Emitter.cs
- SID.cs
- ConfigPathUtility.cs
- StringOutput.cs
- NodeFunctions.cs
- MediaSystem.cs