Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / DataBoundControlParameterTarget.cs / 1305376 / DataBoundControlParameterTarget.cs
namespace System.Web.DynamicData {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;
internal class DataBoundControlParameterTarget : IControlParameterTarget {
private Control _control;
public DataBoundControlParameterTarget(Control control) {
if (control == null) {
throw new ArgumentNullException("control");
}
_control = control;
}
public MetaTable Table {
get {
return _control.FindMetaTable();
}
}
public MetaColumn FilteredColumn {
get {
return null;
}
}
public string GetPropertyNameExpression(string columnName) {
// Get the DataKeyPropertyAttribute and use that as the to get the correct property name expression
DataKeyPropertyAttribute attribute = _control.GetType().GetCustomAttributes(true).OfType().FirstOrDefault();
if ((attribute != null) && !String.IsNullOrEmpty(attribute.Name)) {
return attribute.Name + String.Format(CultureInfo.InvariantCulture, "['{0}']", columnName);
}
//
return String.Empty;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EndpointBehaviorElement.cs
- ContextBase.cs
- RequiredAttributeAttribute.cs
- DataGridAddNewRow.cs
- ToolStripDropDownButton.cs
- PrimitiveXmlSerializers.cs
- FolderBrowserDialog.cs
- UserPreferenceChangingEventArgs.cs
- WsatTransactionFormatter.cs
- DataBinding.cs
- ChildrenQuery.cs
- ReliableRequestSessionChannel.cs
- XmlSchemaObjectTable.cs
- Registry.cs
- TransformedBitmap.cs
- ObjectMaterializedEventArgs.cs
- Msec.cs
- DataTableNewRowEvent.cs
- PropertyValidationContext.cs
- SafePEFileHandle.cs
- StylusPointPropertyId.cs
- PageAdapter.cs
- MethodExpr.cs
- QueryStringParameter.cs
- Crypto.cs
- OdbcConnectionOpen.cs
- MonthChangedEventArgs.cs
- TreeViewEvent.cs
- ValueChangedEventManager.cs
- Accessible.cs
- FixedFindEngine.cs
- ArrayHelper.cs
- TagMapInfo.cs
- ManagementException.cs
- DataGridViewRowsAddedEventArgs.cs
- ChangeBlockUndoRecord.cs
- ObjectKeyFrameCollection.cs
- CurrentChangedEventManager.cs
- ImageList.cs
- ListComponentEditorPage.cs
- AccessViolationException.cs
- xdrvalidator.cs
- TrackingRecord.cs
- SingleKeyFrameCollection.cs
- SqlCacheDependency.cs
- COM2ColorConverter.cs
- ConfigurationSectionGroup.cs
- OdbcUtils.cs
- DataTableMappingCollection.cs
- HyperLinkDesigner.cs
- WebControlsSection.cs
- EnumValAlphaComparer.cs
- EmbeddedMailObjectsCollection.cs
- TraceFilter.cs
- BasicCellRelation.cs
- ExpressionBindingCollection.cs
- RuntimeResourceSet.cs
- PolicyException.cs
- TableAutomationPeer.cs
- WindowsStatic.cs
- ChooseAction.cs
- WebPartEventArgs.cs
- DataTable.cs
- ProtocolsConfigurationHandler.cs
- AppearanceEditorPart.cs
- DataGridViewRowConverter.cs
- Char.cs
- TableLayoutCellPaintEventArgs.cs
- SQLInt16Storage.cs
- WebBrowserUriTypeConverter.cs
- XmlUnspecifiedAttribute.cs
- ToolConsole.cs
- Common.cs
- StrongNamePublicKeyBlob.cs
- ReadOnlyDataSource.cs
- DataGridViewLinkColumn.cs
- ProjectionAnalyzer.cs
- AnnotationHelper.cs
- InlineObject.cs
- MethodAccessException.cs
- StringHandle.cs
- InstanceOwnerException.cs
- MLangCodePageEncoding.cs
- LocationSectionRecord.cs
- ReferenceEqualityComparer.cs
- ContextMenuService.cs
- ChannelManager.cs
- ResourceIDHelper.cs
- RoutedEventValueSerializer.cs
- CmsInterop.cs
- HttpResponse.cs
- SchemaTableOptionalColumn.cs
- OpCopier.cs
- XXXInfos.cs
- ToolStripDesignerAvailabilityAttribute.cs
- Literal.cs
- JsonCollectionDataContract.cs
- Attributes.cs
- XamlDesignerSerializationManager.cs
- ByeMessageCD1.cs