Комментарии:
This helped me a lot. Thank you.
ОтветитьVery straightforward, very nice. Glad to see someone shows an up-to-date way to update both the parent and a child object.
ОтветитьCould you make a table for the objects in details
Ответитьbiggest problem in blazor is it can return file to client and need some controller api to do that ... please learn how real time generate some file and get that file to client
ОтветитьIt would be of great help if you can make a Udemy video on how to create an Invoicing application that manages Inventory, Customers Credit, Customer Payments Email, Invoice, Send SMS, for sure you will have many students in the future
ОтветитьI have written code and it is rendering the inputselect but with no items in the list...
internal RenderFragment CreateCustomEditor(KeyValuePair<string,object> cEditor) => builder =>
{
if (cEditor.Value is ComboBoxEdit)
{
var c = cEditor.Value as ComboBoxEdit;
PropertyInfo prop = mItem.GetType().GetProperty(c.FieldName);
builder.OpenComponent(0, typeof(InputSelect<string>));
var value = prop.GetValue(mItem);
builder.AddAttribute(1, "Value", value);
builder.AddAttribute(2, "class", "form-control h-100 w-100");
builder.AddAttribute(4, "ValueChanged",
RuntimeHelpers.TypeCheck<EventCallback<String>>(EventCallback.Factory.Create<String>
(this, EventCallback.Factory.CreateInferred
(this, __value => prop.SetValue(mItem, __value),
(string)prop.GetValue(mItem)))));
// Create an expression to set the ValueExpression-attribute.
var constant = System.Linq.Expressions.Expression.Constant(mItem, mItem.GetType());
var exp = System.Linq.Expressions.MemberExpression.Property(constant, c.FieldName);
var lamb = System.Linq.Expressions.Expression.Lambda<Func<string>>(exp);
builder.AddAttribute(5, "ValueExpression", lamb);
builder.OpenElement(6, "Option");
builder.AddAttribute(7, "Value", "Wild");
builder.AddContent(8, "Wild");
builder.CloseElement();
//builder.AddMarkupContent(6, "<option value=\"Wild\">Wild</option>");
//builder.AddMarkupContent(7, "<option value=\"Common\">Common</option>");
builder.CloseComponent();
@*<InputSelect Id="name" Class="form-control" @bind-Value="@(mItem.GetType().GetProperty("PetType"))">
<option value="Wild">Wild</option>
<option value="Domestic">Domestic</option>
<option value="Common">Common</option>
</InputSelect>*@
}
};
Hi
Kindly can u make a video on how to render manually inputselect using rendertreebuilder ?