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
- ProbeMatchesMessage11.cs
- DataGridRelationshipRow.cs
- TrackingParticipant.cs
- XmlAttribute.cs
- VisualStyleInformation.cs
- SafeNativeMemoryHandle.cs
- TreeNodeCollection.cs
- Style.cs
- AlternateView.cs
- WindowShowOrOpenTracker.cs
- ComponentTray.cs
- XmlDataSource.cs
- SQLInt32Storage.cs
- ActivityInfo.cs
- dbenumerator.cs
- FileDialogCustomPlacesCollection.cs
- SecurityUtils.cs
- GroupBox.cs
- DefaultEventAttribute.cs
- ImageAnimator.cs
- PersonalizationState.cs
- WebPartTransformerCollection.cs
- LiteralLink.cs
- XpsS0ValidatingLoader.cs
- XsltInput.cs
- Sql8ConformanceChecker.cs
- ClientReliableChannelBinder.cs
- ExtendedTransformFactory.cs
- PolyBezierSegment.cs
- XPathSelectionIterator.cs
- TiffBitmapDecoder.cs
- TextLineBreak.cs
- SqlDataSource.cs
- DragDeltaEventArgs.cs
- User.cs
- DataGridViewSelectedColumnCollection.cs
- httpapplicationstate.cs
- SafeNativeMethods.cs
- DataKeyCollection.cs
- TrailingSpaceComparer.cs
- Timer.cs
- RootProfilePropertySettingsCollection.cs
- DrawingVisual.cs
- PageThemeCodeDomTreeGenerator.cs
- DesignerActionItem.cs
- DependencyPropertyChangedEventArgs.cs
- __ComObject.cs
- DES.cs
- BackStopAuthenticationModule.cs
- ParenthesizePropertyNameAttribute.cs
- HttpSysSettings.cs
- Permission.cs
- PropertyChangingEventArgs.cs
- BitmapEffectInput.cs
- MetabaseServerConfig.cs
- isolationinterop.cs
- OutputCacheSection.cs
- HtmlTableRowCollection.cs
- ArcSegment.cs
- rsa.cs
- CryptoKeySecurity.cs
- NotConverter.cs
- PackageRelationshipCollection.cs
- FloaterParaClient.cs
- ImageMap.cs
- ProcessThread.cs
- CalendarDay.cs
- EpmSourcePathSegment.cs
- sqlstateclientmanager.cs
- Model3D.cs
- PlaceHolder.cs
- AppDomain.cs
- PersonalizationState.cs
- XamlTypeMapper.cs
- DictionaryContent.cs
- HostedTcpTransportManager.cs
- SeekableReadStream.cs
- Process.cs
- _Semaphore.cs
- ListItemCollection.cs
- DataViewManagerListItemTypeDescriptor.cs
- DataSpaceManager.cs
- GradientBrush.cs
- OracleRowUpdatingEventArgs.cs
- ParameterSubsegment.cs
- TransformDescriptor.cs
- DoubleAnimation.cs
- TypeConverterHelper.cs
- CorrelationResolver.cs
- TableFieldsEditor.cs
- ConfigurationStrings.cs
- XPathSelectionIterator.cs
- CodeDomDesignerLoader.cs
- AutomationPropertyInfo.cs
- ModuleBuilderData.cs
- WebPartExportVerb.cs
- Semaphore.cs
- SqlServices.cs
- IconBitmapDecoder.cs
- HtmlProps.cs