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
- ControlBuilderAttribute.cs
- UnknownBitmapDecoder.cs
- ListControlDesigner.cs
- HttpStreamFormatter.cs
- ViewBase.cs
- WindowVisualStateTracker.cs
- DataGridColumn.cs
- ImmutableDispatchRuntime.cs
- ExpandCollapseProviderWrapper.cs
- WebPartCancelEventArgs.cs
- AutoResizedEvent.cs
- FastEncoderStatics.cs
- _LoggingObject.cs
- SerializationObjectManager.cs
- WindowsEditBoxRange.cs
- ListBox.cs
- Listbox.cs
- XhtmlTextWriter.cs
- SendKeys.cs
- StylusTip.cs
- Logging.cs
- DBNull.cs
- ActivityBindForm.cs
- StateChangeEvent.cs
- SqlMethodAttribute.cs
- SetterBase.cs
- MouseGesture.cs
- CompilerWrapper.cs
- CompilerErrorCollection.cs
- ConsumerConnectionPointCollection.cs
- DocumentXmlWriter.cs
- CellTreeNodeVisitors.cs
- ClosableStream.cs
- MultiPartWriter.cs
- PriorityItem.cs
- ToolboxItemFilterAttribute.cs
- WsdlBuildProvider.cs
- MappingMetadataHelper.cs
- XmlBinaryWriterSession.cs
- XmlKeywords.cs
- InputLangChangeEvent.cs
- RMPermissions.cs
- ExclusiveNamedPipeTransportManager.cs
- ThousandthOfEmRealDoubles.cs
- FontWeight.cs
- XmlILTrace.cs
- StackSpiller.Bindings.cs
- InkCanvasAutomationPeer.cs
- TdsRecordBufferSetter.cs
- RtfToken.cs
- TextReader.cs
- EntityDataSourceDesignerHelper.cs
- ServicePoint.cs
- ChainOfResponsibility.cs
- TcpClientSocketManager.cs
- IntPtr.cs
- FontSizeConverter.cs
- GetKeyedHashRequest.cs
- BooleanFunctions.cs
- Fonts.cs
- DecimalAnimationUsingKeyFrames.cs
- SimpleModelProvider.cs
- BackgroundWorker.cs
- OdbcParameter.cs
- securitycriticaldataformultiplegetandset.cs
- QuotedPrintableStream.cs
- TdsParserSessionPool.cs
- COM2PictureConverter.cs
- CultureMapper.cs
- NumericExpr.cs
- ObsoleteAttribute.cs
- x509utils.cs
- MailWebEventProvider.cs
- followingsibling.cs
- SafeBitVector32.cs
- CompModSwitches.cs
- OverlappedAsyncResult.cs
- Switch.cs
- TypeUtils.cs
- PolyLineSegment.cs
- SoapException.cs
- ListDataBindEventArgs.cs
- PromptBuilder.cs
- TargetParameterCountException.cs
- DeflateEmulationStream.cs
- DocumentOrderComparer.cs
- AttachmentService.cs
- SqlClientWrapperSmiStream.cs
- UserNameSecurityTokenAuthenticator.cs
- SendKeys.cs
- Schema.cs
- loginstatus.cs
- AssemblyResourceLoader.cs
- ChangePassword.cs
- TypographyProperties.cs
- DbReferenceCollection.cs
- ContractAdapter.cs
- ButtonPopupAdapter.cs
- FileDialogCustomPlace.cs
- TypeLibConverter.cs