2

我将通过这个示例并尝试让它使用 aSqlDataSource而不是LinqDataSource. 我可以让数据显示在表格中,但是当我选择一行时,表格没有填充数据。我认为这些是相关的代码位:

protected void RowSelect(object sender, DirectEventArgs e)
{
    string employeeID = e.ExtraParams["EmployeeID"];

    Employee empl = Employee.GetEmployee(int.Parse(employeeID));

    this.FormPanel1.SetValues(new {
        empl.EmployeeID,
        empl.FirstName,                          
        empl.LastName,
        ...........
    });
}

<SelectionModel>
    <ext:RowSelectionModel runat="server" Mode="Single">
        <DirectEvents>
            <Select OnEvent="RowSelect" Buffer="250">
                <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{FormPanel1}" />
                <ExtraParams>
                    <ext:Parameter Name="EmployeeID" Value="record.getId()" Mode="Raw" />
                </ExtraParams>
            </Select>
        </DirectEvents>
    </ext:RowSelectionModel>
</SelectionModel>

protected void Store1_Refresh(object sender, StoreReadDataEventArgs e)
{
    this.Store1.DataBind();
}
4

1 回答 1

1

这似乎起到了作用:

<SelectionModel>
    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single">
        <Listeners>
            <Select Handler="#{FormPanel1}.getForm().loadRecord(record);" />
        </Listeners>
    </ext:RowSelectionModel>
</SelectionModel>
于 2012-10-24T18:07:58.967 回答