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
- SimpleBitVector32.cs
- AssemblyCollection.cs
- TypeContext.cs
- ThreadPool.cs
- ProcessModelInfo.cs
- SynchronizedInputProviderWrapper.cs
- PersonalizableAttribute.cs
- LocalizationComments.cs
- SafeSerializationManager.cs
- Unit.cs
- DesignTableCollection.cs
- TakeOrSkipQueryOperator.cs
- ReceiveContext.cs
- TextChangedEventArgs.cs
- InstanceStoreQueryResult.cs
- AddInEnvironment.cs
- HostedBindingBehavior.cs
- WebSysDefaultValueAttribute.cs
- UnmanagedMemoryStream.cs
- SwitchLevelAttribute.cs
- ProviderUtil.cs
- indexingfiltermarshaler.cs
- SponsorHelper.cs
- TraceXPathNavigator.cs
- FontSourceCollection.cs
- TemplateControlParser.cs
- ScriptingProfileServiceSection.cs
- PostBackTrigger.cs
- UIElement3DAutomationPeer.cs
- ContentType.cs
- PathSegmentCollection.cs
- AssemblyName.cs
- SortKey.cs
- AmbientLight.cs
- ProfileInfo.cs
- ExpressionBinding.cs
- WebBaseEventKeyComparer.cs
- Int32Collection.cs
- AsyncResult.cs
- DesignerWebPartChrome.cs
- DataTableClearEvent.cs
- ScriptComponentDescriptor.cs
- GridViewSortEventArgs.cs
- GridViewRowEventArgs.cs
- CalculatedColumn.cs
- Util.cs
- DescriptionAttribute.cs
- BooleanAnimationBase.cs
- EdmFunction.cs
- PassportIdentity.cs
- LiteralDesigner.cs
- AsyncOperationManager.cs
- CreateUserWizard.cs
- SatelliteContractVersionAttribute.cs
- ComPlusContractBehavior.cs
- SettingsBindableAttribute.cs
- UnsignedPublishLicense.cs
- TraceSource.cs
- ScrollBar.cs
- FormViewDeletedEventArgs.cs
- DateTimeOffset.cs
- FormViewPagerRow.cs
- NullableDoubleSumAggregationOperator.cs
- TextUtf8RawTextWriter.cs
- DataServiceClientException.cs
- InputProviderSite.cs
- InvalidProgramException.cs
- Internal.cs
- TypeDelegator.cs
- CodeDomDecompiler.cs
- Compiler.cs
- GridViewDeletedEventArgs.cs
- StylusDownEventArgs.cs
- ProcessStartInfo.cs
- AsymmetricKeyExchangeDeformatter.cs
- TextClipboardData.cs
- MetricEntry.cs
- X509Chain.cs
- InstalledVoice.cs
- RequestContextBase.cs
- XmlSchemaAnyAttribute.cs
- AttachedAnnotation.cs
- HostedHttpTransportManager.cs
- ListControlStringCollectionEditor.cs
- ClientTargetCollection.cs
- WindowsGraphics2.cs
- IdentityHolder.cs
- PasswordBox.cs
- PackageRelationshipCollection.cs
- webbrowsersite.cs
- EntityWithKeyStrategy.cs
- DescriptionAttribute.cs
- BackgroundWorker.cs
- DecoderBestFitFallback.cs
- CodeRegionDirective.cs
- SqlCharStream.cs
- MappingException.cs
- ProviderSettings.cs
- XmlQueryTypeFactory.cs
- SQLMoney.cs