Code:
/ FX-1434 / FX-1434 / 1.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
- ClientScriptManagerWrapper.cs
- ResourceIDHelper.cs
- Receive.cs
- SortFieldComparer.cs
- StackOverflowException.cs
- XhtmlBasicObjectListAdapter.cs
- EdmFunction.cs
- counter.cs
- DesignSurfaceManager.cs
- WebBrowserNavigatingEventHandler.cs
- HitTestFilterBehavior.cs
- AssemblyFilter.cs
- WebPartDescriptionCollection.cs
- ThemeDirectoryCompiler.cs
- QilPatternFactory.cs
- ACL.cs
- WinInetCache.cs
- CopyNamespacesAction.cs
- ClientSettingsStore.cs
- PaperSource.cs
- Listbox.cs
- MemberRelationshipService.cs
- DataGridDesigner.cs
- SeparatorAutomationPeer.cs
- SessionStateItemCollection.cs
- FontStyles.cs
- UIPropertyMetadata.cs
- AddInDeploymentState.cs
- XmlDigitalSignatureProcessor.cs
- RadioButtonList.cs
- TargetException.cs
- ToolStripPanelCell.cs
- DbModificationCommandTree.cs
- UnhandledExceptionEventArgs.cs
- DataGridViewCellStateChangedEventArgs.cs
- XmlMtomWriter.cs
- SqlDataSourceFilteringEventArgs.cs
- ProvidersHelper.cs
- CryptoHelper.cs
- TextElementEnumerator.cs
- ScriptManagerProxy.cs
- ToolStripSystemRenderer.cs
- Utils.cs
- DetailsViewPagerRow.cs
- HtmlValidatorAdapter.cs
- ContractMapping.cs
- DictionarySectionHandler.cs
- AsnEncodedData.cs
- tibetanshape.cs
- ClientScriptManager.cs
- ListCollectionView.cs
- CommunicationObjectFaultedException.cs
- CopyCodeAction.cs
- CryptoStream.cs
- BamlTreeMap.cs
- AddInSegmentDirectoryNotFoundException.cs
- ConnectionManagementElement.cs
- DelegateSerializationHolder.cs
- DecimalKeyFrameCollection.cs
- StructureChangedEventArgs.cs
- StaticExtensionConverter.cs
- EmptyStringExpandableObjectConverter.cs
- GeometryModel3D.cs
- SqlNotificationRequest.cs
- ListBoxItemWrapperAutomationPeer.cs
- Timeline.cs
- XAMLParseException.cs
- Opcode.cs
- ServiceContractGenerator.cs
- CompositeKey.cs
- VectorAnimation.cs
- SamlAdvice.cs
- MimeMultiPart.cs
- SourceElementsCollection.cs
- DataBinder.cs
- UIElementParaClient.cs
- DataSource.cs
- StrongTypingException.cs
- DoubleSumAggregationOperator.cs
- Bits.cs
- WebConfigurationHostFileChange.cs
- IpcClientChannel.cs
- KeyBinding.cs
- VersionConverter.cs
- ImageClickEventArgs.cs
- ButtonBase.cs
- DocumentOrderQuery.cs
- AsymmetricSignatureFormatter.cs
- OpCopier.cs
- Int32.cs
- SmiEventSink_DeferedProcessing.cs
- NavigationFailedEventArgs.cs
- PermissionListSet.cs
- SparseMemoryStream.cs
- SchemaMapping.cs
- HttpStreamMessageEncoderFactory.cs
- ProgressChangedEventArgs.cs
- RuleSettings.cs
- XmlDocumentViewSchema.cs
- CodeExpressionStatement.cs