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
- CqlBlock.cs
- HostedHttpContext.cs
- MSAAWinEventWrap.cs
- ExpressionParser.cs
- WebPartsPersonalizationAuthorization.cs
- DataBoundControlAdapter.cs
- RenderContext.cs
- TemplateControl.cs
- TraceContext.cs
- SequentialOutput.cs
- HashHelpers.cs
- HttpDictionary.cs
- SingleAnimation.cs
- BufferedGraphics.cs
- MatrixConverter.cs
- EndPoint.cs
- TypefaceCollection.cs
- PreviewPrintController.cs
- HtmlTableCell.cs
- CompensationTokenData.cs
- ConfigXmlReader.cs
- PublisherIdentityPermission.cs
- MeasureData.cs
- ListSourceHelper.cs
- FocusManager.cs
- TableCell.cs
- DesignerVerbToolStripMenuItem.cs
- StorageMappingItemCollection.cs
- PathFigure.cs
- cryptoapiTransform.cs
- SessionEndingEventArgs.cs
- ItemContainerProviderWrapper.cs
- Rect.cs
- WpfSharedXamlSchemaContext.cs
- ResourceManagerWrapper.cs
- CodeSnippetCompileUnit.cs
- formatstringdialog.cs
- ScrollChangedEventArgs.cs
- SafeRegistryKey.cs
- DataGridViewAutoSizeModeEventArgs.cs
- DbParameterCollectionHelper.cs
- TableRow.cs
- Size3D.cs
- AtomServiceDocumentSerializer.cs
- XmlSchemaChoice.cs
- BypassElementCollection.cs
- VerticalAlignConverter.cs
- SiteMapNodeItemEventArgs.cs
- RowToFieldTransformer.cs
- ClientApiGenerator.cs
- Win32.cs
- HostedTransportConfigurationManager.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- ConsoleTraceListener.cs
- PrintPageEvent.cs
- SignatureHelper.cs
- EntityDataSourceMemberPath.cs
- DescendentsWalkerBase.cs
- DesignerDataSourceView.cs
- HtmlContainerControl.cs
- webeventbuffer.cs
- MimeXmlImporter.cs
- SimpleHandlerBuildProvider.cs
- ReferenceSchema.cs
- PackageDigitalSignatureManager.cs
- NodeFunctions.cs
- DragStartedEventArgs.cs
- XmlElement.cs
- FormViewModeEventArgs.cs
- KeyConverter.cs
- TextBoxView.cs
- PingOptions.cs
- CollectionViewGroupInternal.cs
- IdentityReference.cs
- PageSettings.cs
- PageAsyncTaskManager.cs
- ProtectedProviderSettings.cs
- ScriptComponentDescriptor.cs
- TreeSet.cs
- SmiMetaData.cs
- WindowsSolidBrush.cs
- FontDriver.cs
- RouteItem.cs
- RectangleGeometry.cs
- StateWorkerRequest.cs
- ParamArrayAttribute.cs
- SqlInternalConnectionSmi.cs
- DataChangedEventManager.cs
- ToolStripControlHost.cs
- HttpListenerResponse.cs
- ContextMenuAutomationPeer.cs
- Style.cs
- GotoExpression.cs
- SecurityKeyUsage.cs
- Single.cs
- FamilyTypeface.cs
- Transform3D.cs
- SqlFileStream.cs
- DragEvent.cs
- SystemBrushes.cs