Show combined values in GridForeignColumn dropdown

Hello,

I have this foreign column:

<GridForeignColumn Field=@nameof(StoreLimit.StoreId) HeaderText="Tienda" TValue="Store" ForeignKeyField="Id" ForeignKeyValue="Code" AutoFit="true" EditorSettings="StoreEditParams" Width="100">
<ChildContent>
<SfDataManager Headers=@HeaderData Url=@($"{apiURL}/store") Adaptor="Adaptors.ODataV4Adaptor" CrossDomain="true"></SfDataManager>
</ChildContent>
<Template>
@{
var cntxt = (context as StoreLimit);
if (cntxt.Store != null)
{
<span>@cntxt.Store.Code - @cntxt.Store.ShortName</span>
}
}
</Template>
</GridForeignColumn>


How can I add a dropdown template for showing two fields ("Code" and "ShortName") instead of the default (showing only "Code" selection parameter)? Similar to the Templ

Thanks

Erick




2 Replies

SP Sarveswaran Palani Syncfusion Team September 19, 2022 05:51 PM UTC

Hi Erick,

We are currently Validating the reported query at our end, and we will update the further details within two business days. Until then we appreciate your patience.

Regards,

Sarveswaran PK



SP Sarveswaran Palani Syncfusion Team September 21, 2022 05:36 PM UTC

Hi Erick,


Greetings from Syncfusion support.


Query: Add a dropdown template for showing two fields


we have analyzed your query and would able to show two fields in single dropdown using Dropdown Template. Please refer to the below documentation and online demo for more details for reference.


Documentation : https://blazor.syncfusion.com/documentation/dropdown-list/templates


Online Demo : https://blazor.syncfusion.com/demos/dropdown-list/template?theme=fluent


Kindly get back to us if you have any further queries


Regards,

Sarveswaran PK


Loader.
Up arrow icon