Back to Devexpress

GanttMappingInfoBase.Key Property

aspnet-devexpress-dot-web-dot-aspxgantt-dot-ganttmappinginfobase.md

latest2.2 KB
Original Source

GanttMappingInfoBase.Key Property

Specifies an object’s unique identifier.

Namespace : DevExpress.Web.ASPxGantt

Assembly : DevExpress.Web.ASPxGantt.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("ID")]
public string Key { get; set; }
vb
<DefaultValue("ID")>
Public Property Key As String

Property Value

TypeDefaultDescription
String"ID"

A unique identifier.

|

Remarks

Run Demo: ASPxGantt - Data BindingRun Demo: MVCxGantt - Data Binding and Editing

Web Forms:

aspx
<dx:ASPxGantt ID="Gantt" runat="server" Width="100%" KeyFieldName="ID" ParentFieldName="ParentID" ...>
    <Task Key="ID" ParentKey="ParentID" Title="Subject" Start="StartDate" End="EndDate" Progress="PercentComplete" />
    ...
</dx:ASPxGantt>

MVC:

cshtml
@Html.DevExpress().Gantt(settings => {
    settings.Name = "gantt";
    ...
    settings.Mappings.Task.Key = "ID";
    settings.Mappings.Task.ParentKey = "ParentID";
    settings.Mappings.Task.Title = "Subject";
    settings.Mappings.Task.Start = "StartDate";
    settings.Mappings.Task.End = "EndDate";
    settings.Mappings.Task.Progress = "PercentComplete";
    ...
}).Bind(
    GanttDataProvider.Tasks, 
    GanttDataProvider.Dependencies, 
    GanttDataProvider.Resources, 
    GanttDataProvider.ResourceAssignments
).GetHtml()

Examples

See Also

GanttMappingInfoBase Class

GanttMappingInfoBase Members

DevExpress.Web.ASPxGantt Namespace