Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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; } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NumberFormatInfo.cs
- ConstrainedDataObject.cs
- SoapHeaderAttribute.cs
- RuntimeEnvironment.cs
- CompositeControlDesigner.cs
- DataGridItem.cs
- ListViewDesigner.cs
- Parameter.cs
- InstanceDataCollection.cs
- IfAction.cs
- PrimitiveDataContract.cs
- WinHttpWebProxyFinder.cs
- XmlDataSourceNodeDescriptor.cs
- StyleSheetRefUrlEditor.cs
- WindowsGrip.cs
- prefixendpointaddressmessagefiltertable.cs
- MatrixAnimationBase.cs
- TypeUsageBuilder.cs
- HttpServerVarsCollection.cs
- ObjectPropertyMapping.cs
- ComNativeDescriptor.cs
- Context.cs
- OdbcConnectionStringbuilder.cs
- WebPartConnectionsDisconnectVerb.cs
- DecoratedNameAttribute.cs
- DataSourceListEditor.cs
- EditingCoordinator.cs
- PackUriHelper.cs
- ImageListStreamer.cs
- ListenerConnectionDemuxer.cs
- EventLogStatus.cs
- TextServicesHost.cs
- SynchronizationContext.cs
- AppManager.cs
- CalendarDay.cs
- BamlStream.cs
- InkCanvasSelection.cs
- SubtreeProcessor.cs
- coordinator.cs
- SystemException.cs
- DiscoveryClientProtocol.cs
- FormatterServices.cs
- GeneratedCodeAttribute.cs
- BuildTopDownAttribute.cs
- PingOptions.cs
- DbDataAdapter.cs
- QilTargetType.cs
- ADConnectionHelper.cs
- FigureParaClient.cs
- FixedNode.cs
- CodeLinePragma.cs
- MultiByteCodec.cs
- TerminatorSinks.cs
- DefaultAsyncDataDispatcher.cs
- Compiler.cs
- BitmapPalettes.cs
- SynchronizedDispatch.cs
- MSAAWinEventWrap.cs
- WebHttpBindingElement.cs
- FlowDocumentPaginator.cs
- ConfigurationElementProperty.cs
- OleDbSchemaGuid.cs
- SlipBehavior.cs
- InsufficientMemoryException.cs
- DoubleAnimationClockResource.cs
- DiagnosticTrace.cs
- XPathSelfQuery.cs
- RegexParser.cs
- InvariantComparer.cs
- _DigestClient.cs
- DataIdProcessor.cs
- CommandBindingCollection.cs
- FixedPage.cs
- XmlUtf8RawTextWriter.cs
- DurableTimerExtension.cs
- GridViewCancelEditEventArgs.cs
- SolidColorBrush.cs
- ResourceExpression.cs
- TextElement.cs
- SortableBindingList.cs
- DataServiceProcessingPipelineEventArgs.cs
- UnaryNode.cs
- InkCanvas.cs
- ListBindingHelper.cs
- ContentPathSegment.cs
- XmlConvert.cs
- LicenseException.cs
- ManagementDateTime.cs
- XMLDiffLoader.cs
- DecoratedNameAttribute.cs
- ToolStripPanelRow.cs
- QueryUtil.cs
- Transform3D.cs
- EFColumnProvider.cs
- MessageSmuggler.cs
- WorkItem.cs
- MsmqAppDomainProtocolHandler.cs
- DeobfuscatingStream.cs
- EnumBuilder.cs
- WindowsFormsHostPropertyMap.cs