Get DataValueField of DayPilot in Code Behind

177 views Asked by At

I am using daypilot schedular in my asp.net application. how can i get the value of DataValuefield in Code behind.

 <DayPilot:DayPilotScheduler ID="DayPilotScheduler1" runat="server" 
    DataStartField="start" 
    DataEndField="end" 
    DataIdField = "AppId"
    DataTextField="name" 
    DataValueField="id" 
    ViewType="Gantt"
    >
</DayPilot:DayPilotScheduler>

I tried e.Value but it is getting DataIdField. How to get DataValueField ?

Protected Sub DayPilotScheduler1_EventMove(ByVal sender As Object, ByVal e As EventMoveEventArgs)

Dim id as string = e.Value  //gets DataIdField


End Sub
1

There are 1 answers

0
Kᴀτᴢ On

As seen on this link the DataValueField is obsolete:

Gets or sets the name of the column that contains the id (primary key). Obsolete. Use .DataIdField instead.

In my project I can access the value this way:

DataValueField="id" //column "id" of my source table

Get it in BeforeEventRender:

string id = (string)e.DataItem["id"];