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
- SqlConnectionPoolGroupProviderInfo.cs
- GPRECTF.cs
- OrderedDictionaryStateHelper.cs
- WhitespaceRule.cs
- Axis.cs
- RevocationPoint.cs
- ListBoxItem.cs
- EtwTrace.cs
- ListControl.cs
- GenerateTemporaryTargetAssembly.cs
- DummyDataSource.cs
- SystemBrushes.cs
- ArrayTypeMismatchException.cs
- IIS7ConfigurationLoader.cs
- DiscoveryMessageProperty.cs
- SingleTagSectionHandler.cs
- XmlKeywords.cs
- BoundsDrawingContextWalker.cs
- Separator.cs
- LinqTreeNodeEvaluator.cs
- ResourceContainer.cs
- Group.cs
- PropertyToken.cs
- PersonalizationProviderHelper.cs
- DelegatedStream.cs
- ViewStateModeByIdAttribute.cs
- FontDialog.cs
- LookupNode.cs
- ReferenceList.cs
- XmlExpressionDumper.cs
- ExpressionBuilder.cs
- RijndaelManaged.cs
- XsdBuildProvider.cs
- SelectionEditor.cs
- Model3DCollection.cs
- BaseTemplatedMobileComponentEditor.cs
- Polyline.cs
- ToolStripSplitStackLayout.cs
- TabControlCancelEvent.cs
- HtmlInputReset.cs
- ListItemCollection.cs
- FileDialog_Vista_Interop.cs
- DateTimeUtil.cs
- WinFormsComponentEditor.cs
- TypeSystem.cs
- ArgIterator.cs
- WsatConfiguration.cs
- TypeConverterAttribute.cs
- Maps.cs
- WorkflowOperationInvoker.cs
- CodeTypeDeclarationCollection.cs
- MethodToken.cs
- SizeAnimationUsingKeyFrames.cs
- WindowsGraphicsCacheManager.cs
- CrossSiteScriptingValidation.cs
- Clipboard.cs
- ServiceBusyException.cs
- XmlSchemaSimpleType.cs
- TextEncodedRawTextWriter.cs
- ProfileParameter.cs
- BreakRecordTable.cs
- PersistenceTask.cs
- TempEnvironment.cs
- KeyGestureConverter.cs
- TemplatedWizardStep.cs
- CodeChecksumPragma.cs
- DbUpdateCommandTree.cs
- OperationCanceledException.cs
- MenuItemAutomationPeer.cs
- CookielessData.cs
- TokenBasedSet.cs
- OdbcConnectionStringbuilder.cs
- PromptBuilder.cs
- GridPattern.cs
- LocatorPart.cs
- BitStream.cs
- SHA256.cs
- _BufferOffsetSize.cs
- WindowsListViewItemStartMenu.cs
- InplaceBitmapMetadataWriter.cs
- Rectangle.cs
- PropertyTabChangedEvent.cs
- LinqTreeNodeEvaluator.cs
- TreeNodeStyle.cs
- PackagingUtilities.cs
- DbMetaDataColumnNames.cs
- x509utils.cs
- XmlWhitespace.cs
- ImageSourceValueSerializer.cs
- EventWaitHandle.cs
- BindingObserver.cs
- CompilationPass2Task.cs
- CodeConditionStatement.cs
- SqlInternalConnection.cs
- SyntaxCheck.cs
- MessageBox.cs
- RbTree.cs
- TraceFilter.cs
- _RequestCacheProtocol.cs
- HierarchicalDataBoundControl.cs