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
- CompositeDesignerAccessibleObject.cs
- RadioButtonRenderer.cs
- _TransmitFileOverlappedAsyncResult.cs
- _AutoWebProxyScriptWrapper.cs
- RootBrowserWindowAutomationPeer.cs
- TagNameToTypeMapper.cs
- SecurityDescriptor.cs
- InputScopeAttribute.cs
- ErrorFormatter.cs
- KeyValuePair.cs
- TypeForwardedFromAttribute.cs
- ProtocolsConfigurationHandler.cs
- Stopwatch.cs
- AstTree.cs
- WorkingDirectoryEditor.cs
- SqlCacheDependencyDatabaseCollection.cs
- HighlightComponent.cs
- OpacityConverter.cs
- SafeFileMapViewHandle.cs
- ReferencedCollectionType.cs
- SmiConnection.cs
- SiteOfOriginPart.cs
- userdatakeys.cs
- Viewport3DVisual.cs
- XPathDocumentIterator.cs
- MessageAction.cs
- ArgumentValueSerializer.cs
- VideoDrawing.cs
- FolderBrowserDialog.cs
- HashAlgorithm.cs
- IsolatedStorageFilePermission.cs
- BamlRecords.cs
- XmlAttributes.cs
- Slider.cs
- ProcessModelInfo.cs
- SchemaElementLookUpTable.cs
- NavigationPropertyAccessor.cs
- VerificationAttribute.cs
- AnimationTimeline.cs
- ResourceCategoryAttribute.cs
- TextRangeBase.cs
- DirectoryNotFoundException.cs
- WebBrowserDesigner.cs
- HttpResponseHeader.cs
- AttributeInfo.cs
- ScrollBarRenderer.cs
- Listbox.cs
- QilPatternVisitor.cs
- BinarySerializer.cs
- SQLGuid.cs
- PersonalizableAttribute.cs
- CompilationUtil.cs
- DefaultPropertyAttribute.cs
- PlainXmlSerializer.cs
- Mappings.cs
- VBCodeProvider.cs
- ListCollectionView.cs
- UnsafeNetInfoNativeMethods.cs
- dataobject.cs
- InvalidOperationException.cs
- XmlQueryCardinality.cs
- Publisher.cs
- ComplexPropertyEntry.cs
- ManipulationStartingEventArgs.cs
- nulltextcontainer.cs
- HwndSubclass.cs
- DecoderFallbackWithFailureFlag.cs
- DoubleAnimationClockResource.cs
- RegexBoyerMoore.cs
- NullReferenceException.cs
- SqlConnection.cs
- HtmlSelect.cs
- SessionSwitchEventArgs.cs
- ProtectedConfiguration.cs
- ParameterElementCollection.cs
- FileFormatException.cs
- WorkflowMessageEventHandler.cs
- CodeIdentifier.cs
- TabRenderer.cs
- Label.cs
- TypeNameConverter.cs
- Certificate.cs
- SchemaHelper.cs
- SerialErrors.cs
- BinaryReader.cs
- DeclarationUpdate.cs
- SystemUnicastIPAddressInformation.cs
- UdpChannelFactory.cs
- EncoderReplacementFallback.cs
- DynamicArgumentDialog.cs
- WebControlToolBoxItem.cs
- Decoder.cs
- ReferenceSchema.cs
- ApplicationContext.cs
- DropShadowBitmapEffect.cs
- NativeMethods.cs
- AtlasWeb.Designer.cs
- CodeExpressionCollection.cs
- MarkupCompilePass1.cs
- dsa.cs