Hi Support Team
I tried to combine 2 different models.
This is my code.
My first problem is data in GridForeignColumn Field=@nameof(Crypto.Symbol) is always null after adding new rows.
My second problem is Combobox in Add Dialog always keeps the latest value and does not refresh after adding new or editing.
All my code is in the archive file.
I also add 2 gif files to help you know about that cases
"Gif Problem Files\Data from Droplist couldn't add.gif"
"Gif Problem Files\Add Dialog - Combobox not refesh and still keep current value.gif"
Thanks
|
<div id="iPage">
<SfGrid DataSource="@cryptos" ID="Grid" @ref="Grid"
AllowPaging="true"
. ..
<GridColumns>
<GridColumn Field=@nameof(Crypto.CryptoId) HeaderText="Crypto ID" HeaderTextAlign="TextAlign.Center" IsPrimaryKey="true" AllowAdding="false" AllowEditing="false"></GridColumn>
<GridForeignColumn Field=@nameof(Crypto.Symbol) HeaderText="Symbol" EditType="EditType.DropDownEdit" ForeignKeyValue="@nameof(PriceDto.Name)" ForeignDataSource="@Prices" Width="150">
<EditTemplate>
<SfComboBox ID=@nameof(PriceDto.Symbol) TValue="string" TItem="PriceDto" @ref="cbxSelectCoin" Placeholder="Select a coin" @bind-Value="@((context as Crypto).Symbol)" DataSource="@Prices" AllowFiltering="true">
<ComboBoxEvents TItem="PriceDto" TValue="string" ValueChange="SelectedCoinChanged" Filtering="args => OnFilter(cbxSelectCoin, args)"></ComboBoxEvents>
<ComboBoxFieldSettings Text=@nameof(PriceDto.Name) Value=@nameof(PriceDto.Symbol)></ComboBoxFieldSettings>
</SfComboBox>
</EditTemplate>
</GridForeignColumn>
. . .
</GridColumns>
</SfGrid>
</div>
|
Hi Rahul,
Thanks for the sample to help me solve the problem.
Now I understand more about the way that can combine grid and combobox controls.
Regards,
Khang.