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
- ProgressBarRenderer.cs
- RemotingServices.cs
- FragmentQuery.cs
- ResourcePermissionBase.cs
- TcpChannelHelper.cs
- FileClassifier.cs
- TCPClient.cs
- SmiContextFactory.cs
- TransformDescriptor.cs
- DbParameterCollection.cs
- ActivityExecutorOperation.cs
- BaseDataList.cs
- TabOrder.cs
- DocComment.cs
- PageRanges.cs
- FieldDescriptor.cs
- mda.cs
- AutomationPatternInfo.cs
- DesignerHost.cs
- XmlChoiceIdentifierAttribute.cs
- XNodeValidator.cs
- Part.cs
- XappLauncher.cs
- CompoundFileStreamReference.cs
- ListViewGroupConverter.cs
- UnmanagedMemoryStream.cs
- HwndProxyElementProvider.cs
- CacheForPrimitiveTypes.cs
- StrokeCollectionConverter.cs
- StateManagedCollection.cs
- Scene3D.cs
- NamedPermissionSet.cs
- FontDialog.cs
- CompensationDesigner.cs
- TraceSection.cs
- ToggleButton.cs
- SplineKeyFrames.cs
- ReadOnlyObservableCollection.cs
- JpegBitmapDecoder.cs
- Geometry.cs
- LocatorBase.cs
- ReadWriteControlDesigner.cs
- ResponseStream.cs
- Nullable.cs
- SourceFileInfo.cs
- DataGridHeaderBorder.cs
- InputLanguage.cs
- PartialClassGenerationTaskInternal.cs
- OracleBFile.cs
- Vector3DAnimation.cs
- TextTreeRootNode.cs
- DbQueryCommandTree.cs
- ExternalDataExchangeClient.cs
- ObjectDataSourceMethodEventArgs.cs
- SimpleExpression.cs
- DateTimePickerDesigner.cs
- ConstructorNeedsTagAttribute.cs
- GifBitmapEncoder.cs
- WebPartConnectionsCancelVerb.cs
- EncryptedKeyIdentifierClause.cs
- ArgumentException.cs
- MemoryRecordBuffer.cs
- XmlSchemaIdentityConstraint.cs
- TagPrefixAttribute.cs
- OptimalBreakSession.cs
- ContentElement.cs
- Brushes.cs
- TraceHandlerErrorFormatter.cs
- FileVersionInfo.cs
- ObjectSet.cs
- ScriptingSectionGroup.cs
- PublishLicense.cs
- SettingsAttributes.cs
- TypeUtil.cs
- SerializationInfoEnumerator.cs
- ResourceProviderFactory.cs
- WebPartConnectionsDisconnectVerb.cs
- ConstructorNeedsTagAttribute.cs
- PropagatorResult.cs
- IInstanceTable.cs
- DataComponentMethodGenerator.cs
- Select.cs
- StyleSelector.cs
- MenuItemCollection.cs
- TextContainerChangeEventArgs.cs
- ResourceAssociationSet.cs
- DataTemplateKey.cs
- RegisteredScript.cs
- NativeStructs.cs
- LogLogRecord.cs
- CodeTypeDelegate.cs
- sqlmetadatafactory.cs
- Storyboard.cs
- XmlAttributeOverrides.cs
- _UriSyntax.cs
- ZipIOLocalFileHeader.cs
- TextLine.cs
- SchemaNamespaceManager.cs
- AxHost.cs
- PageThemeCodeDomTreeGenerator.cs