Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / TableDesigner.cs / 1 / TableDesigner.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System; using System.Collections; using System.ComponentModel; using Microsoft.Win32; using System.Diagnostics; using System.Web.UI.WebControls; ////// /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags = System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] [SupportsPreviewControl(true)] public class TableDesigner : ControlDesigner { public override string GetDesignTimeHtml() { Table table = (Table)ViewControl; TableRowCollection rows = table.Rows; bool emptyTable = (rows.Count == 0); bool emptyRows = false; if (emptyTable) { TableRow row = new TableRow(); rows.Add(row); TableCell cell = new TableCell(); cell.Text = "###"; rows[0].Cells.Add(cell); } else { emptyRows = true; for (int i = 0; i < rows.Count; i++) { if (rows[i].Cells.Count != 0) { emptyRows = false; break; } } if (emptyRows == true) { TableCell cell = new TableCell(); cell.Text = "###"; rows[0].Cells.Add(cell); } } if (emptyTable == false) { // rows and cells were defined by the user, but if the cells are empty // then something needs to be done about that, so they are visible foreach (TableRow row in rows) { foreach (TableCell cell in row.Cells) { if ((cell.Text.Length == 0) && (cell.HasControls() == false)) { cell.Text = "###"; } } } } return base.GetDesignTimeHtml(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved./// The designer for the ////// web control. ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataFieldEditor.cs
- DataGridViewRowEventArgs.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ServiceTimeoutsElement.cs
- ReliableOutputConnection.cs
- WindowsComboBox.cs
- SecurityTokenProvider.cs
- DeploymentExceptionMapper.cs
- ThreadExceptionEvent.cs
- KeyboardEventArgs.cs
- SecureEnvironment.cs
- HMACRIPEMD160.cs
- Permission.cs
- InvalidOleVariantTypeException.cs
- OutKeywords.cs
- PageThemeParser.cs
- ParenthesizePropertyNameAttribute.cs
- MulticastNotSupportedException.cs
- RegionInfo.cs
- MultiPageTextView.cs
- GiveFeedbackEvent.cs
- BasicKeyConstraint.cs
- DATA_BLOB.cs
- Parameter.cs
- HandlerBase.cs
- MembershipSection.cs
- CanonicalFormWriter.cs
- TabPage.cs
- RowToFieldTransformer.cs
- SqlInfoMessageEvent.cs
- StreamInfo.cs
- IndexingContentUnit.cs
- StackOverflowException.cs
- EdmMember.cs
- SiteMapProvider.cs
- XmlSchemaGroup.cs
- LocalTransaction.cs
- TabControlDesigner.cs
- CalendarAutomationPeer.cs
- DesignerInterfaces.cs
- DataRelationPropertyDescriptor.cs
- ConfigXmlDocument.cs
- ListSortDescription.cs
- InternalTransaction.cs
- Propagator.JoinPropagator.cs
- Control.cs
- TextRange.cs
- ParameterModifier.cs
- GACIdentityPermission.cs
- DynamicValidator.cs
- WebPartConnectionsConfigureVerb.cs
- RangeBase.cs
- Claim.cs
- StreamGeometry.cs
- SQLInt16Storage.cs
- Int32CollectionValueSerializer.cs
- DocumentViewerBaseAutomationPeer.cs
- ManagementOptions.cs
- CommandBinding.cs
- WindowsListViewItemCheckBox.cs
- ListViewInsertEventArgs.cs
- XmlSchemaAnnotation.cs
- SelectionEditor.cs
- HostingEnvironmentException.cs
- Light.cs
- COM2EnumConverter.cs
- Part.cs
- ErrorStyle.cs
- DataMemberFieldEditor.cs
- HwndKeyboardInputProvider.cs
- FeatureAttribute.cs
- UserMapPath.cs
- StyleCollection.cs
- RuntimeConfigLKG.cs
- UniqueConstraint.cs
- XmlNodeChangedEventArgs.cs
- Base64Decoder.cs
- ExpandCollapsePattern.cs
- SafeReversePInvokeHandle.cs
- SiteMapProvider.cs
- XmlEntityReference.cs
- SqlProviderServices.cs
- StatusBarItemAutomationPeer.cs
- DynamicResourceExtensionConverter.cs
- XmlMemberMapping.cs
- TableItemStyle.cs
- SimpleHandlerBuildProvider.cs
- UnsafeNativeMethods.cs
- DriveNotFoundException.cs
- StubHelpers.cs
- PackagePartCollection.cs
- documentsequencetextcontainer.cs
- PeerApplicationLaunchInfo.cs
- XsltCompileContext.cs
- SqlException.cs
- EUCJPEncoding.cs
- DurableErrorHandler.cs
- SrgsGrammar.cs
- WorkflowApplicationAbortedEventArgs.cs
- WinHttpWebProxyFinder.cs