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
- OleDbConnectionPoolGroupProviderInfo.cs
- DataObject.cs
- TextCollapsingProperties.cs
- PowerStatus.cs
- WinInet.cs
- DesignerVerb.cs
- ManagementObject.cs
- Hash.cs
- XamlSerializationHelper.cs
- recordstatefactory.cs
- WebPartZoneDesigner.cs
- DiagnosticTrace.cs
- CorrelationQuery.cs
- Panel.cs
- ConfigurationValidatorBase.cs
- ExpressionWriter.cs
- XamlToRtfWriter.cs
- RoleGroup.cs
- KeyMatchBuilder.cs
- CompilationUnit.cs
- AutomationPatternInfo.cs
- Environment.cs
- SafeNativeMethods.cs
- XhtmlBasicTextViewAdapter.cs
- CoreSwitches.cs
- MailDefinition.cs
- RuleSetCollection.cs
- precedingquery.cs
- OSEnvironmentHelper.cs
- Container.cs
- XmlDataDocument.cs
- PEFileEvidenceFactory.cs
- NamedPipeAppDomainProtocolHandler.cs
- NumericUpDown.cs
- ToolStripPanelRow.cs
- Event.cs
- UriWriter.cs
- Array.cs
- SafeMarshalContext.cs
- ExclusiveCanonicalizationTransform.cs
- DesignerAdapterUtil.cs
- KnownTypesHelper.cs
- EditorPartCollection.cs
- NegotiateStream.cs
- SqlDataSourceQueryConverter.cs
- NullableDecimalAverageAggregationOperator.cs
- Viewport3DVisual.cs
- TransportChannelListener.cs
- DesignTimeTemplateParser.cs
- BitVector32.cs
- DependencyObjectPropertyDescriptor.cs
- CodeSubDirectory.cs
- mediaeventargs.cs
- ServiceNameElement.cs
- ImpersonationContext.cs
- BamlRecords.cs
- ResourcesChangeInfo.cs
- CodeVariableReferenceExpression.cs
- BindingNavigator.cs
- DataGridCommandEventArgs.cs
- MouseGestureConverter.cs
- RecognizedPhrase.cs
- AttributeParameterInfo.cs
- ProfileService.cs
- ProgressPage.cs
- ValueChangedEventManager.cs
- ResourcePermissionBaseEntry.cs
- OdbcConnectionOpen.cs
- PrintEvent.cs
- TitleStyle.cs
- SymbolEqualComparer.cs
- ScriptIgnoreAttribute.cs
- TrustLevelCollection.cs
- Function.cs
- EditBehavior.cs
- SelectorItemAutomationPeer.cs
- PropertyBuilder.cs
- Vector3DAnimation.cs
- ExternalFile.cs
- CellConstantDomain.cs
- FacetEnabledSchemaElement.cs
- Utilities.cs
- Point3D.cs
- WebPartActionVerb.cs
- UnmanagedMemoryStream.cs
- SByte.cs
- DataColumnPropertyDescriptor.cs
- CommonGetThemePartSize.cs
- Emitter.cs
- VectorKeyFrameCollection.cs
- BamlStream.cs
- Attributes.cs
- Html32TextWriter.cs
- NullableDecimalMinMaxAggregationOperator.cs
- BevelBitmapEffect.cs
- XmlSerializationReader.cs
- SqlServer2KCompatibilityAnnotation.cs
- Matrix3D.cs
- ImageAttributes.cs
- TripleDESCryptoServiceProvider.cs