Hi,
when the component is started, the data for the dependent second datagrid is queried correctly.
When you select a row in the first datagrid, the description text is updated correctly, but the second datagrid is not updated.
Please give me a hint or example where it works.
Initiail:
After Selection:
<SfGrid TValue="Order" AllowPaging="true">
<GridPageSettings PageSize="4"></GridPageSettings>
<GridEvents RowSelected="RowSelecthandler" RowDeselected="Deselected" TValue="Order"></GridEvents>
<SfDataManager Url=https://services.odata.org/V4/Northwind/Northwind.svc/Orders Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
<h4>Kostenstellen des Geschaeftsfeldes: @AbteilungBez</h4>
<SfGrid TValue="Customer" Query="@Qry" AllowPaging="true">
<GridPageSettings PageSize="5"></GridPageSettings>
Adaptor="Adaptors.ODataV4Adaptor">
</SfDataManager>
<GridColumns>
<GridColumn Field=@nameof(Customer.CustomerID) HeaderText="ID" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
@code
{
public Query Qry { get; set; }
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
}
public class Customer
{
public string CustomerID { get; set; }
public string Address { get; set; }
}
public string AbteilungBez { get; set; }
public void RowSelecthandler(RowSelectEventArgs<Order> args)
{
Qry = new Query().Where("CustomerID", "equal", args.Data.CustomerID);
AbteilungBez = args.Data.CustomerID;
}
public void Deselected(RowDeselectEventArgs<Order> Args)
{
Qry = new Query() { };
}
|