@foreach (var value in myComponents)
{
var textValue = value.Value;
<SfTextBox @bind-Value="@textValue" Placeholder="Enter Name" ValueChange="((ChangedEventArgs args)=> TextBoxChangeEvent( args, value.Key))" />
<span>
<p> the value is @value.Value</p>
</span>}
@code {
private Dictionary<string, string> myComponents = new Dictionary<string, string>(){
{"TextboxObj1","value first"},
{"TextboxObj2","Value second"},
{"TextboxObj3", "value third" }
};
public void TextBoxChangeEvent(ChangedEventArgs args, string value)
{
myComponents[value] = args.Value;
}
}
|
|
<SfGrid DataSource="@GridData" Toolbar="@(new string[] {"Add", "Edit" ,"Delete","Update","Cancel" })">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="@EditMode.Dialog">
<Template>
@{
var Order = (context as OrdersDetails);
<div>
@foreach (var value in myComponents)
{
var textValue = value.Value;
<TextComponent Tkey="@value.Key" textValue="@textValue"></TextComponent>
<span>
<p> the value is @value.Value</p>
</span>
}
. . . . .
}
</Template>
</GridEditSettings>
</SfGrid>
[TextComponent.razor]
@using Syncfusion.Blazor.Inputs<SfTextBox @bind-Value="@textValue" Placeholder="Enter Name" ValueChange="((ChangedEventArgs args)=> TextBoxChangeEvent( args, Tkey))" />@code { [Parameter] public string textValue { get; set; } [Parameter] public string Tkey { get; set; } public void TextBoxChangeEvent(ChangedEventArgs args, string value) { }} |
|