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
- XmlBinaryWriterSession.cs
- ResourceReferenceExpressionConverter.cs
- JavaScriptObjectDeserializer.cs
- COM2ExtendedUITypeEditor.cs
- DataGridColumnFloatingHeader.cs
- ValidatedControlConverter.cs
- PackageController.cs
- PrePostDescendentsWalker.cs
- ButtonBase.cs
- AuthenticationModuleElementCollection.cs
- CodeTypeMemberCollection.cs
- AnimationClock.cs
- ImmutableObjectAttribute.cs
- SearchForVirtualItemEventArgs.cs
- FontStyle.cs
- WebPartsPersonalizationAuthorization.cs
- ServerIdentity.cs
- HttpListenerException.cs
- WebSysDisplayNameAttribute.cs
- FontStretch.cs
- HttpCachePolicyBase.cs
- OleDbDataAdapter.cs
- DownloadProgressEventArgs.cs
- ComplexPropertyEntry.cs
- CompareValidator.cs
- ExecutionContext.cs
- InternalMappingException.cs
- WebDescriptionAttribute.cs
- UIPermission.cs
- LineServicesCallbacks.cs
- SmiRequestExecutor.cs
- LoginView.cs
- BitmapCacheBrush.cs
- OdbcInfoMessageEvent.cs
- MgmtResManager.cs
- StateItem.cs
- XmlBindingWorker.cs
- CodeGeneratorOptions.cs
- ExceptionUtil.cs
- CodeThrowExceptionStatement.cs
- PropertyValueChangedEvent.cs
- TextFormatterContext.cs
- SafeNativeMethodsCLR.cs
- ReadOnlyAttribute.cs
- RealizationContext.cs
- PresentationAppDomainManager.cs
- GroupBoxAutomationPeer.cs
- _DomainName.cs
- SystemWebExtensionsSectionGroup.cs
- _AutoWebProxyScriptHelper.cs
- IConvertible.cs
- ToolboxItemCollection.cs
- InboundActivityHelper.cs
- SqlNodeTypeOperators.cs
- WebPartEditorOkVerb.cs
- SqlBooleanizer.cs
- FormConverter.cs
- PackageStore.cs
- ToolStripSettings.cs
- XmlSchemaCompilationSettings.cs
- FloaterParaClient.cs
- shaperfactory.cs
- SQLRoleProvider.cs
- DescendantBaseQuery.cs
- DataSourceExpressionCollection.cs
- SignatureHelper.cs
- WindowsTokenRoleProvider.cs
- RootBrowserWindowAutomationPeer.cs
- DataGridViewCellValueEventArgs.cs
- XmlSchemaIdentityConstraint.cs
- MetaModel.cs
- EnumerableCollectionView.cs
- SQLResource.cs
- ViewSimplifier.cs
- BitmapEffectInput.cs
- CompiledRegexRunner.cs
- BoundField.cs
- KeyToListMap.cs
- ProfileSettings.cs
- BooleanFacetDescriptionElement.cs
- ConfigurationManagerHelperFactory.cs
- ModelTreeEnumerator.cs
- XmlQueryCardinality.cs
- AstTree.cs
- HwndMouseInputProvider.cs
- OneWayChannelListener.cs
- DefaultProxySection.cs
- FontConverter.cs
- FontUnitConverter.cs
- HttpDictionary.cs
- UnauthorizedWebPart.cs
- SafeProcessHandle.cs
- ComponentRenameEvent.cs
- RegionInfo.cs
- Debug.cs
- InitializerFacet.cs
- HierarchicalDataSourceControl.cs
- FileSystemWatcher.cs
- IQueryable.cs
- EntityStoreSchemaFilterEntry.cs