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
- ModelItemDictionaryImpl.cs
- HttpProfileBase.cs
- GlobalizationAssembly.cs
- DictationGrammar.cs
- PeerPresenceInfo.cs
- AuthenticationException.cs
- TraceLog.cs
- ProxyAttribute.cs
- TypeUtil.cs
- Parser.cs
- SharedPerformanceCounter.cs
- LineMetrics.cs
- PtsContext.cs
- RouteItem.cs
- Label.cs
- SqlAliasesReferenced.cs
- TriggerBase.cs
- Int32CAMarshaler.cs
- JoinTreeNode.cs
- ScrollPattern.cs
- OleDbPropertySetGuid.cs
- DeflateStream.cs
- BoundPropertyEntry.cs
- XmlIncludeAttribute.cs
- AdapterDictionary.cs
- AddingNewEventArgs.cs
- ColorMatrix.cs
- PropertySegmentSerializationProvider.cs
- ItemList.cs
- ViewCellSlot.cs
- PropertyValueUIItem.cs
- ListBoxItem.cs
- WorkflowRuntimeSection.cs
- UnhandledExceptionEventArgs.cs
- ImageKeyConverter.cs
- CollectionChangeEventArgs.cs
- HttpException.cs
- NamespaceCollection.cs
- RuntimeConfigurationRecord.cs
- ListViewTableCell.cs
- DBBindings.cs
- DataGridView.cs
- BaseCAMarshaler.cs
- StringAttributeCollection.cs
- OperationResponse.cs
- DataControlField.cs
- ClientSession.cs
- ProfileSection.cs
- SqlExpressionNullability.cs
- DescendantOverDescendantQuery.cs
- _BufferOffsetSize.cs
- HttpPostProtocolImporter.cs
- MultiDataTrigger.cs
- UrlMappingsSection.cs
- ImageConverter.cs
- ValidateNames.cs
- XslCompiledTransform.cs
- HttpException.cs
- RemoveStoryboard.cs
- SelectionRange.cs
- filewebresponse.cs
- HtmlInputText.cs
- SplineKeyFrames.cs
- MergePropertyDescriptor.cs
- CellParagraph.cs
- LogicalExpr.cs
- MonthCalendar.cs
- SimpleType.cs
- DateTimeFormat.cs
- ObsoleteAttribute.cs
- IdentityHolder.cs
- DelegateTypeInfo.cs
- StreamedFramingRequestChannel.cs
- HttpRuntimeSection.cs
- AstNode.cs
- SystemIPGlobalStatistics.cs
- InputLanguageCollection.cs
- CodeMethodInvokeExpression.cs
- WorkflowViewElement.cs
- HtmlLink.cs
- PartialList.cs
- Rectangle.cs
- BitmapImage.cs
- EncryptedType.cs
- ScrollItemPatternIdentifiers.cs
- LinkDescriptor.cs
- FileCodeGroup.cs
- SizeAnimationBase.cs
- BooleanFacetDescriptionElement.cs
- InlineObject.cs
- ScriptMethodAttribute.cs
- RegistryHandle.cs
- PartialTrustHelpers.cs
- XmlTypeMapping.cs
- RenderTargetBitmap.cs
- _TLSstream.cs
- WebPartVerbCollection.cs
- StringOutput.cs
- RoutingChannelExtension.cs
- MsdtcWrapper.cs