Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SizeKeyFrameCollection.cs
- RadioButtonStandardAdapter.cs
- DocumentGridContextMenu.cs
- FormViewPagerRow.cs
- MobileErrorInfo.cs
- ReaderWriterLockSlim.cs
- TraceHandlerErrorFormatter.cs
- RSAPKCS1KeyExchangeFormatter.cs
- TiffBitmapDecoder.cs
- LongCountAggregationOperator.cs
- InheritedPropertyChangedEventArgs.cs
- EdmItemCollection.cs
- OperationInfoBase.cs
- DLinqAssociationProvider.cs
- SystemResources.cs
- Preprocessor.cs
- DropShadowEffect.cs
- SafeEventHandle.cs
- SpnegoTokenAuthenticator.cs
- QueryExpr.cs
- WindowsSecurityTokenAuthenticator.cs
- PackagePart.cs
- templategroup.cs
- StyleCollection.cs
- Margins.cs
- ServiceHttpModule.cs
- SBCSCodePageEncoding.cs
- ViewCellRelation.cs
- QilName.cs
- CommandHelpers.cs
- WebPartRestoreVerb.cs
- SineEase.cs
- TextDecoration.cs
- NetworkInformationException.cs
- EventWaitHandleSecurity.cs
- UTF8Encoding.cs
- Error.cs
- CultureInfoConverter.cs
- TextBox.cs
- DesignerSerializationManager.cs
- XmlDigitalSignatureProcessor.cs
- DocComment.cs
- RpcCryptoRequest.cs
- DataSetUtil.cs
- ProcessModuleCollection.cs
- BindUriHelper.cs
- GeneralTransform3DTo2D.cs
- KeyGestureConverter.cs
- ExponentialEase.cs
- SystemInformation.cs
- SystemWebExtensionsSectionGroup.cs
- InternalDispatchObject.cs
- CodeEventReferenceExpression.cs
- TransactionChannelListener.cs
- Geometry.cs
- SplineKeyFrames.cs
- Geometry3D.cs
- WindowsRebar.cs
- FrameworkPropertyMetadata.cs
- MetadataProperty.cs
- StrongNameIdentityPermission.cs
- DSASignatureFormatter.cs
- SqlDataSourceCommandEventArgs.cs
- SqlDataSourceView.cs
- WebPartCatalogCloseVerb.cs
- DataGridBoundColumn.cs
- PointAnimation.cs
- CqlIdentifiers.cs
- MemberListBinding.cs
- ShutDownListener.cs
- FontDialog.cs
- PropertyRef.cs
- SiteMembershipCondition.cs
- IpcClientManager.cs
- ShaderRenderModeValidation.cs
- TcpTransportSecurity.cs
- LoginCancelEventArgs.cs
- ClockGroup.cs
- XslException.cs
- ObjectStateFormatter.cs
- AlgoModule.cs
- DataObjectPastingEventArgs.cs
- thaishape.cs
- CompiledELinqQueryState.cs
- DbExpressionBuilder.cs
- ModelFunctionTypeElement.cs
- Panel.cs
- NonVisualControlAttribute.cs
- SafeViewOfFileHandle.cs
- RuntimeHandles.cs
- SqlCommandBuilder.cs
- IndexedGlyphRun.cs
- DefaultBindingPropertyAttribute.cs
- TextRunCache.cs
- ByteStreamMessageEncoderFactory.cs
- AutoCompleteStringCollection.cs
- ServiceReference.cs
- WCFServiceClientProxyGenerator.cs
- SqlBinder.cs
- MouseGesture.cs