Intersoft WebGrid Documentation
SortKeyField Property
See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGridColumn Class : SortKeyField Property






Gets or sets the sort key field for SortColumn.

Syntax

Visual Basic (Declaration) 
<NotifyParentPropertyAttribute(True)>
<DefaultValueAttribute()>
<ISNet.Serialization.BinarySerializableAttribute()>
<DescriptionAttribute("Gets or sets the sort key field for SortedColumn.")>
<EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.WebGrid.DataFieldEditor, ISNet.WebUI.WebGrid, Version=8.0.7200.100, Culture=neutral, PublicKeyToken=3e60b85fb8502d5e")>
Public Property SortKeyField As String
Visual Basic (Usage)Copy Code
Dim instance As WebGridColumn
Dim value As String
 
instance.SortKeyField = value
 
value = instance.SortKeyField
C# 
[NotifyParentPropertyAttribute(true)]
[DefaultValueAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[DescriptionAttribute("Gets or sets the sort key field for SortedColumn.")]
[EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.WebGrid.DataFieldEditor, ISNet.WebUI.WebGrid, Version=8.0.7200.100, Culture=neutral, PublicKeyToken=3e60b85fb8502d5e")]
public string SortKeyField {get; set;}
Delphi 
public read-write property SortKeyField: String; 
JScript 
NotifyParentPropertyAttribute()
DefaultValueAttribute()
ISNet.Serialization.BinarySerializableAttribute()
DescriptionAttribute("Gets or sets the sort key field for SortedColumn.")
EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.WebGrid.DataFieldEditor, ISNet.WebUI.WebGrid, Version=8.0.7200.100, Culture=neutral, PublicKeyToken=3e60b85fb8502d5e")
public function get,set SortKeyField : String
Managed Extensions for C++ 
[NotifyParentPropertyAttribute(true)]
[DefaultValueAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[DescriptionAttribute("Gets or sets the sort key field for SortedColumn.")]
[EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.WebGrid.DataFieldEditor, ISNet.WebUI.WebGrid, Version=8.0.7200.100, Culture=neutral, PublicKeyToken=3e60b85fb8502d5e")]
public: __property string* get_SortKeyField();
public: __property void set_SortKeyField( 
   string* value
);
C++/CLI 
[NotifyParentPropertyAttribute(true)]
[DefaultValueAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[DescriptionAttribute("Gets or sets the sort key field for SortedColumn.")]
[EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.WebGrid.DataFieldEditor, ISNet.WebUI.WebGrid, Version=8.0.7200.100, Culture=neutral, PublicKeyToken=3e60b85fb8502d5e")]
public:
property String^ SortKeyField {
   String^ get();
   void set (    String^ value);
}

Remarks

This property is designed to be used for SortColumn only. Generally, you can leave this property to blank when the SortColumn's ColumnMember is the field that you want to sort. In many scenarios, you may want to sort other key field while the ColumnMember is a field which translated by ValueList such as EmployeeID. One of the most implemented scenario is where you used ValueList to translate the EmployeeID into a useful information such as EmployeeName and you also want to sort the data by EmployeeName instead of the EmployeeID when user clicked on the EmployeeID column. In this context, you can simply set the SortKeyField of the WebGridColumn to EmployeeName and the built-in sorting operation will use the specified WebGridColumn's SortKeyField property instead of the ColumnMember's DataMember.

Note: Make sure that the SortKeyField is available in your DataSource. It is not necessary to add the SortKeyField in WebGridColumnCollection.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.