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
- CodeTypeParameter.cs
- BasePropertyDescriptor.cs
- wmiprovider.cs
- OpenTypeLayoutCache.cs
- SimpleType.cs
- SQLMoney.cs
- DefaultAsyncDataDispatcher.cs
- ResponseStream.cs
- SqlConnectionString.cs
- streamingZipPartStream.cs
- SizeChangedInfo.cs
- Help.cs
- ApplicationFileCodeDomTreeGenerator.cs
- PermissionSetTriple.cs
- ResXFileRef.cs
- TitleStyle.cs
- XPathParser.cs
- LocalizedNameDescriptionPair.cs
- SystemKeyConverter.cs
- TextEndOfLine.cs
- formatter.cs
- Effect.cs
- OutOfProcStateClientManager.cs
- ExpandableObjectConverter.cs
- MailMessage.cs
- TdsRecordBufferSetter.cs
- RightsManagementPermission.cs
- XmlAnyElementAttributes.cs
- SecurityResources.cs
- XmlAttribute.cs
- SafeFileMappingHandle.cs
- CharStorage.cs
- CodeArrayIndexerExpression.cs
- GiveFeedbackEvent.cs
- HandleCollector.cs
- ReferenceEqualityComparer.cs
- WebConfigurationFileMap.cs
- ObjectStorage.cs
- IndexedGlyphRun.cs
- BindUriHelper.cs
- PagedDataSource.cs
- LinqMaximalSubtreeNominator.cs
- CodeAssignStatement.cs
- PrintingPermissionAttribute.cs
- Tablet.cs
- DataViewManagerListItemTypeDescriptor.cs
- Events.cs
- UInt64.cs
- Directory.cs
- SessionStateUtil.cs
- PeerApplicationLaunchInfo.cs
- SystemIPGlobalProperties.cs
- KerberosSecurityTokenProvider.cs
- FeatureAttribute.cs
- MLangCodePageEncoding.cs
- FontCacheUtil.cs
- LoginViewDesigner.cs
- NativeMethods.cs
- ContextMenuStripActionList.cs
- EncryptedXml.cs
- TraceContextRecord.cs
- UIElementHelper.cs
- OrCondition.cs
- Error.cs
- ObjectCloneHelper.cs
- ColumnTypeConverter.cs
- CodePageUtils.cs
- PeerCollaborationPermission.cs
- ProfileProvider.cs
- SequenceFullException.cs
- FlowDocumentPage.cs
- SecurityTokenParametersEnumerable.cs
- StreamInfo.cs
- NetTcpSection.cs
- SvcMapFileSerializer.cs
- Crc32.cs
- SQLChars.cs
- SqlDataSourceWizardForm.cs
- DataGridToolTip.cs
- InputLanguageEventArgs.cs
- contentDescriptor.cs
- Graphics.cs
- ExpandoObject.cs
- SqlDataRecord.cs
- RepeaterItemEventArgs.cs
- VScrollProperties.cs
- DesignerTransactionCloseEvent.cs
- ServiceManager.cs
- SqlBooleanizer.cs
- SpoolingTask.cs
- HebrewCalendar.cs
- SchemaName.cs
- FocusWithinProperty.cs
- PolyLineSegment.cs
- DocobjHost.cs
- XmlSchemaSimpleTypeRestriction.cs
- ScrollableControl.cs
- CfgParser.cs
- FilterQueryOptionExpression.cs
- UpdatePanelTrigger.cs