2016-08-02 107 views
0

我在我的asp.net應用程序中使用daypilot schedular。我如何在代碼後面獲取DataValuefield的值。在代碼後面獲取DayPilot的DataValueField

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

我試過e.Value,但它變得DataIdField。如何獲得DataValueField

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

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


End Sub 
+0

什麼是不工作的你'Event'或'e.Value '聲明?您的DayPilotScheduler1_EventMove會在更改時被解僱嗎?如果沒有,我認爲你應該添加'EventMoveHandling =「PostBack」'來回發你的事件。 –

+0

事件觸發和e.Value包含「AppId」。我也需要得到「id」 – Abdul

回答

0

正如所看到的在此linkDataValueField的是過時:

獲取或設置包含ID(主鍵)的列的名稱。已過時。改用.DataIdField。

在我的項目,我可以訪問該值是這樣的:

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

得到它BeforeEventRender

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