Display text instead of value in Grid

Is there a way to display the selected Text instead of showing the binded value in a grid that has an autocomplete or combobox inside the column.

I know that if I use a combo box, you have         <ComboBoxFieldSettings Text="Name" Value="CustAccount"></ComboBoxFieldSettings>
Which will achieve this just for a combo box. but when you have the combo box inside a grid column, it basically binds it to the value and displays that value but i want it to display the Text once selected from the combo box in the grid instead of the value, but also keep the actual value in the grid.

hopefully that makes sense thanks.

1 Reply 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team November 19, 2020 03:05 PM UTC

Hi Chris, 

Greetings from Syncfusion support. 

We suspect that you would like to save the selected text from the ComboBox items in a Grid column(i.e.) you would like to save the values to the CustomerID column upon editing with the values from ShipCountry field. If so, then we suggest you to use as like the below code. Provide both the Text and Value property as ShipCountry for the CustomerID column. 

 
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"> 
    <EditTemplate> 
        <SfComboBox ID="CustomerID" TValue="string" TItem="Order" @bind-Value="@((context as Order).CustomerID)" DataSource="@Orders"> 
            <ComboBoxFieldSettings Text="ShipCountry" Value="ShipCountry"></ComboBoxFieldSettings> 
        </SfComboBox> 
    </EditTemplate> 
</GridColumn> 


We are also attaching the sample for your reference, please download the sample form the link below, 
 
If we have misunderstood your query or if you still need further assistance, then kindly share with us the following details for better assistance. 
  1. Share with us a detailed explanation of your complete requirement.
  2. Share a video demo explaining your exact requirement.
  3. Share the detailed explanation of the problem you are facing in achieving your requirement.

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

Regards, 
Renjith Singh Rajendran 


Marked as answer
Loader.
Up arrow icon