We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

After selection, no values are put into the cells in Add mode

Hi,

with the code :

<GridColumn HeaderText="descrizione" TextAlign="TextAlign.Left" Width="200">

<Template>

@{

var cit = (context as CausaleItem);

Conto ForeignKeyData = GridConti.Where(x => x.id == cit.conto_id).FirstOrDefault();

<span>@ForeignKeyData.descrizionespan>

}

Template>

<EditTemplate>

<SfComboBox ID="ContoId"

TItem="Conto"

TValue="long"

@bind-Value="@((context as CausaleItem).conto_id)"

DataSource="@GridConti"

Enabled="IsEnabled">

<ComboBoxEvents TValue="long" TItem="Conto" />

@*

@{

Conto ForeignKeyData = GridConti.Where(x => x.id == ChildContext.id).FirstOrDefault();

@ForeignKeyData.descrizione

//@ForeignKeyData.descrizione @ForeignKeyData.mastro

}

*@

<ComboBoxFieldSettings Value="id" Text="descrizione">ComboBoxFieldSettings>

SfComboBox>

EditTemplate>

GridColumn>



<GridColumn HeaderText="mastro" AllowEditing="true" AllowAdding="true" TextAlign="TextAlign.Left" Width="200">

<Template>

@{

var cit = (context as CausaleItem);

Conto ForeignKeyData = GridConti.Where(x => x.id == cit.conto_id).FirstOrDefault();

<span>@ForeignKeyData.mastrospan>

}

Template>


<EditTemplate>

@{

var cit = (context as CausaleItem);

if (cit.conto_id > 0)

{

Conto ForeignKeyData = GridConti.Where(x => x.id == cit.conto_id).FirstOrDefault();

<span>@ForeignKeyData.mastrospan>

}

else

{

<span>span>

}

}

EditTemplate>


GridColumn>


<GridColumn HeaderText="sottoconto" AllowEditing="false" AllowAdding="false" TextAlign="TextAlign.Left" Width="200">

<Template>

@{

var cit = (context as CausaleItem);

Conto ForeignKeyData = GridConti.Where(x => x.id == cit.conto_id).FirstOrDefault();

<span>@ForeignKeyData.sottocontospan>

}

Template>


<EditTemplate>

@{

var cit = (context as CausaleItem);

if (cit.conto_id > 0)

{

Conto ForeignKeyData = GridConti.Where(x => x.id == cit.conto_id).FirstOrDefault();

<span>@ForeignKeyData.sottocontospan>

}

else

{

<span>span>

}

}

EditTemplate>

GridColumn>

------------------------------------>

I allow editing to choose a value in the description cell and automatically display the value in the "Mastro" and "Sottoconto" cell in the editing mode;

Unfortunately, in the "add" mode it does not happen as shown in the attached figure.

How can I solve this problem ? Thank you

Greetings

Bye



Attachment: Add_on_Grid1_214be5f3.rar


1 Reply

PS Prathap Senthil Syncfusion Team November 11, 2022 09:18 AM


Hi Biagio,


Greetings from Syncfusion support


Based on your reported issue, we created a sample, but we were unable to reproduce the reported issue in our end version [20.3.0.56]. Kindly check the attached sample for your reference.


If the reported issue persists, or we misunderstood your query kindly share as the below details validate further at our end.


  1. Share with us the entire Grid code snippet along with the model class.
  2. Share with us the NuGet version used.
  3. Share with us the video demonstration of the issue.
  4. If possible, kindly share with us the simple issue reproducible sample or modify the reported issue on the above-mentioned sample.


The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible


Regards,

Prathap S


Attachment: BlazorGrid_90e5eb8b.zip

Loader.
Live Chat Icon For mobile
Up arrow icon