Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- TableItemStyle.cs
- SqlUserDefinedTypeAttribute.cs
- LowerCaseStringConverter.cs
- XPathConvert.cs
- SessionStateItemCollection.cs
- TreeNodeConverter.cs
- ObjectHandle.cs
- AsyncCallback.cs
- FontNamesConverter.cs
- VariableQuery.cs
- DynamicQueryableWrapper.cs
- NavigationHelper.cs
- SettingsSection.cs
- SqlGenericUtil.cs
- EntityDataSource.cs
- DataServiceQueryException.cs
- DateTimeParse.cs
- SqlProcedureAttribute.cs
- CompiledQuery.cs
- DynamicHyperLink.cs
- HybridWebProxyFinder.cs
- ThicknessAnimationUsingKeyFrames.cs
- LocalizableAttribute.cs
- SqlLiftIndependentRowExpressions.cs
- HtmlString.cs
- StylusDownEventArgs.cs
- CfgSemanticTag.cs
- EntityClientCacheEntry.cs
- SoapSchemaMember.cs
- SchemaObjectWriter.cs
- BatchWriter.cs
- FormsAuthenticationCredentials.cs
- WriteableBitmap.cs
- UIEndRequest.cs
- CurrencyManager.cs
- DocumentApplicationDocumentViewer.cs
- ConfigXmlAttribute.cs
- DoWorkEventArgs.cs
- CodeExpressionCollection.cs
- DesignerSelectionListAdapter.cs
- LogExtentCollection.cs
- CompilerErrorCollection.cs
- messageonlyhwndwrapper.cs
- MarginCollapsingState.cs
- SiteMapSection.cs
- ScrollProperties.cs
- BulletedListEventArgs.cs
- RouteUrlExpressionBuilder.cs
- IHttpResponseInternal.cs
- DataControlButton.cs
- TextMetrics.cs
- DynamicValidatorEventArgs.cs
- PrintController.cs
- RegexCompilationInfo.cs
- Function.cs
- SiteMembershipCondition.cs
- AutomationIdentifier.cs
- ListItemConverter.cs
- OciLobLocator.cs
- FileDialog.cs
- ToolStripDropDownClosedEventArgs.cs
- MaskedTextBoxTextEditorDropDown.cs
- MyContact.cs
- DataGridViewCheckBoxCell.cs
- ConnectionProviderAttribute.cs
- SimpleWebHandlerParser.cs
- UserCancellationException.cs
- TypeEnumerableViewSchema.cs
- XmlAttributeAttribute.cs
- ToolStripDropDown.cs
- SortDescriptionCollection.cs
- QilXmlWriter.cs
- ComPlusServiceHost.cs
- ServiceHttpModule.cs
- ObjectViewListener.cs
- DBBindings.cs
- XmlDataSourceNodeDescriptor.cs
- BrowserCapabilitiesCodeGenerator.cs
- QueueTransferProtocol.cs
- DataContractSerializerOperationBehavior.cs
- ComPlusServiceHost.cs
- WhitespaceRuleLookup.cs
- WindowHideOrCloseTracker.cs
- Matrix3D.cs
- ServiceOperationInvoker.cs
- filewebresponse.cs
- AuthenticatedStream.cs
- TypeLoadException.cs
- XmlQualifiedNameTest.cs
- ItemDragEvent.cs
- TemplateControl.cs
- Rijndael.cs
- TextElementAutomationPeer.cs
- ipaddressinformationcollection.cs
- XmlSchemaDocumentation.cs
- ArraySubsetEnumerator.cs
- TypeSystem.cs
- ObjectDataSourceChooseTypePanel.cs
- LinqDataSourceDisposeEventArgs.cs
- ForeignKeyConstraint.cs