2016-08-02 106 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"];