我将通过这个示例并尝试让它使用 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();
}