Code:
/ FX-1434 / FX-1434 / 1.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
- DiscoveryEndpoint.cs
- TextAdaptor.cs
- GridViewItemAutomationPeer.cs
- TextServicesDisplayAttribute.cs
- FormViewInsertEventArgs.cs
- ImpersonationContext.cs
- EndEvent.cs
- CommandLibraryHelper.cs
- SQLChars.cs
- XmlChoiceIdentifierAttribute.cs
- DataPagerFieldItem.cs
- Terminate.cs
- ButtonRenderer.cs
- HtmlTernaryTree.cs
- ScrollItemPattern.cs
- CommonObjectSecurity.cs
- Package.cs
- FactoryGenerator.cs
- DateTime.cs
- CurrentTimeZone.cs
- BitmapEffect.cs
- OneWayChannelFactory.cs
- HelloOperationCD1AsyncResult.cs
- SchemaManager.cs
- InnerItemCollectionView.cs
- HwndAppCommandInputProvider.cs
- XmlSchemaImport.cs
- ControlIdConverter.cs
- InternalReceiveMessage.cs
- dbenumerator.cs
- Crc32.cs
- MachineKeyConverter.cs
- SystemFonts.cs
- ImageList.cs
- LinkDesigner.cs
- XmlAtomicValue.cs
- ResourceCollectionInfo.cs
- PropertyOverridesDialog.cs
- SemanticBasicElement.cs
- TrackingProfileDeserializationException.cs
- Point3DValueSerializer.cs
- DirectionalLight.cs
- CaseInsensitiveComparer.cs
- DecodeHelper.cs
- KnownTypes.cs
- XamlReaderHelper.cs
- TypeListConverter.cs
- SqlFunctions.cs
- BindingSource.cs
- WebPartCatalogAddVerb.cs
- ColumnWidthChangedEvent.cs
- XPathExpr.cs
- MenuItem.cs
- SelectedGridItemChangedEvent.cs
- DataGridView.cs
- safesecurityhelperavalon.cs
- LeafCellTreeNode.cs
- DataPager.cs
- ChainedAsyncResult.cs
- DataSvcMapFile.cs
- _NegotiateClient.cs
- AngleUtil.cs
- ProcessHostConfigUtils.cs
- InsufficientMemoryException.cs
- IDReferencePropertyAttribute.cs
- ViewGenResults.cs
- DataGridViewRowCancelEventArgs.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- FormViewUpdatedEventArgs.cs
- Vector.cs
- TCEAdapterGenerator.cs
- QuaternionRotation3D.cs
- elementinformation.cs
- EmbeddedMailObject.cs
- FlowThrottle.cs
- XPathArrayIterator.cs
- TimeSpanValidator.cs
- XmlFileEditor.cs
- MergeLocalizationDirectives.cs
- ExpressionDumper.cs
- Expression.cs
- PlatformNotSupportedException.cs
- TimelineCollection.cs
- AttributeUsageAttribute.cs
- OutputCacheSettingsSection.cs
- XmlIlGenerator.cs
- CommandCollectionEditor.cs
- TagNameToTypeMapper.cs
- SqlDataSourceEnumerator.cs
- LineGeometry.cs
- SmiMetaData.cs
- PathSegment.cs
- TypeSystem.cs
- DoubleCollection.cs
- AbstractSvcMapFileLoader.cs
- Line.cs
- TextEditorThreadLocalStore.cs
- TextContainer.cs
- XmlSchemaInfo.cs
- XpsPackagingPolicy.cs