0

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
Abdul
  • 2,002
  • 7
  • 31
  • 65
  • What's not working your `Event` or the `e.Value` statement? Does your `DayPilotScheduler1_EventMove` get fired on change? If no I think You should add `EventMoveHandling="PostBack"` to fire your event on postback. – Rojalin Sahoo Aug 02 '16 at 11:35
  • Event fires and e.Value contains "AppId". I need to get "id" too – Abdul Aug 02 '16 at 11:44

1 Answers1

0

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"];

Kᴀτᴢ
  • 2,146
  • 6
  • 29
  • 57