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
- CheckBoxDesigner.cs
- LinkConverter.cs
- DesignTimeParseData.cs
- StaticResourceExtension.cs
- FilterQuery.cs
- BooleanConverter.cs
- EasingKeyFrames.cs
- UnsafePeerToPeerMethods.cs
- MailWebEventProvider.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- HotSpotCollection.cs
- Permission.cs
- BinaryObjectWriter.cs
- Events.cs
- GcSettings.cs
- QueryableDataSourceHelper.cs
- DataTableNewRowEvent.cs
- PropertyConverter.cs
- ServiceTimeoutsElement.cs
- KeyedHashAlgorithm.cs
- ParseNumbers.cs
- MissingSatelliteAssemblyException.cs
- ShaperBuffers.cs
- CornerRadius.cs
- SelectedDatesCollection.cs
- SafeViewOfFileHandle.cs
- ServiceMetadataBehavior.cs
- Compiler.cs
- NaturalLanguageHyphenator.cs
- LayoutManager.cs
- RemotingAttributes.cs
- HtmlFormAdapter.cs
- MDIWindowDialog.cs
- Typeface.cs
- OleDbConnectionFactory.cs
- DeleteStoreRequest.cs
- FormsAuthenticationTicket.cs
- Application.cs
- RequestQueue.cs
- ConstraintConverter.cs
- ToolboxItemFilterAttribute.cs
- Transform3DGroup.cs
- BookmarkUndoUnit.cs
- MemoryRecordBuffer.cs
- connectionpool.cs
- ActivityExecutor.cs
- PropertyItem.cs
- OleDbMetaDataFactory.cs
- SqlBulkCopyColumnMapping.cs
- DataGridViewColumnCollectionEditor.cs
- ProviderSettings.cs
- Soap.cs
- PeerUnsafeNativeMethods.cs
- ControlBindingsCollection.cs
- UIElementPropertyUndoUnit.cs
- PictureBox.cs
- ToolStripDesignerAvailabilityAttribute.cs
- MouseBinding.cs
- ConfigUtil.cs
- StaticResourceExtension.cs
- ResourceKey.cs
- GroupItemAutomationPeer.cs
- HtmlInputRadioButton.cs
- InternalControlCollection.cs
- PerformanceCounter.cs
- ComponentFactoryHelpers.cs
- LookupBindingPropertiesAttribute.cs
- DataService.cs
- DoubleLinkList.cs
- SafeViewOfFileHandle.cs
- FunctionCommandText.cs
- VersionUtil.cs
- SQLUtility.cs
- ManagementNamedValueCollection.cs
- WindowsListViewItemStartMenu.cs
- ContentFileHelper.cs
- PartialTrustValidationBehavior.cs
- GreenMethods.cs
- XmlDataImplementation.cs
- Repeater.cs
- TabControl.cs
- PathTooLongException.cs
- BindToObject.cs
- DataColumnMappingCollection.cs
- DisposableCollectionWrapper.cs
- IndexerNameAttribute.cs
- PrimitiveSchema.cs
- TreeBuilderXamlTranslator.cs
- StatusStrip.cs
- DependencyStoreSurrogate.cs
- UserPreferenceChangedEventArgs.cs
- ButtonBase.cs
- SamlAssertion.cs
- PropertyBuilder.cs
- NameHandler.cs
- RbTree.cs
- InternalSafeNativeMethods.cs
- BindingList.cs
- CompositionAdorner.cs
- Point4D.cs