Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
HansM
@SeppPenner
@SamProf I can't use https://blazorfiddle.com/ properly. Can you have a look at the wesbite. It seems like no actions are possible at all... Ok, forget it. It works again... :D
@freddysotof Nope, it doesn't seem to be possible. Check https://blazorfiddle.com/s/dniijonr.
noamarbel
@noamarbel

@noamarbel Maybe something like this (I haven't tested it) works:

@foreach (var prod in await (() => GetProducts(Category)))
{
    <MatOptionString Value="@prod">@prod</MatOptionString>
}

Nope, this is not possible (it is a C# restriction, not Blazor)

HansM
@SeppPenner
@yingwu88 Do you want to align the label or the input value?
HansM
@SeppPenner
@yingwu88 You maybe need to overwrite .mdc-text-field .mdc-floating-label and its right, top and left properties. .mdc-text-field{text-align:center;} only sets the input text to be centered, not the label.
HansM
@SeppPenner
@noamarbel That was what I expected already... The most simple solution, but the ugliest: use GetProducts(Category).Result...
noamarbel
@noamarbel

@noamarbel That was what I expected already... The most simple solution, but the ugliest: use GetProducts(Category).Result...

That does not work either. You cannot use Task.Result. It returns on a different thread, and hands the application :(

yingwu88
@yingwu88
@SeppPenner I am trying to align the input text to the center. thank you.
noamarbel
@noamarbel
Finally got this to work, thanks to Dani Herrera on SOF. Trick was to use the ValueChanged event, and not a simple bind-Value.
<MatSelect 
    Outlined="true" 
    Label="Category" 
    ValueChanged="(string i)=>OnChangeCategory(i)"> @* <-- here *@
    <MatOptionString></MatOptionString>
    @foreach (var cat in GetCategories())
    {
        <MatOptionString Value="@cat">@cat</MatOptionString>
    }
</MatSelect>

@code
{
   protected async Task OnChangeCategory(string newValue)
   {
      this.Category = newValue;
      // call backend async tasks
      // ...
   }
soomon
@soomon
@noamarbel awesome! thanks for sharing!
noamarbel
@noamarbel
Anyone else seeing issues with BlazorFiddler?
adds39939
@adds39939
Yo the MatBlazor site seems broken, tried mutliple browsers and devices
Clark Alesna
@Mercurial
same here
HansM
@SeppPenner
@noamarbel Yeah, that would have been my next suggestion as well :D
@noamarbel @adds39939 @Mercurial Now it seems to be fixed again? As far as I know, there sometimes are issues with the server space (And @SamProf needs to clear this).
HansM
@SeppPenner
@yingwu88 I now understand why {text-align:center;} doesn't work as Style: Style sets the class to the surrounding div. not to the input. I guess, this is quite easy to solve. I will show you an example soon :)
HansM
@SeppPenner
@yingwu88 I will try to create an example project, the fiddle is quite limited in this case...
HansM
@SeppPenner

@yingwu88 What I have tried in CSS so far is this: .mat-text-field-input .mdc-text-field__input ._mdc-text-field--upgraded { text-align: center !important; }

This doesn't work, however...

Artur Gromek
@arturgromek
any contributors have the steps to build the nuget from source?
nevermind :))
Vladimir Samoilenko
@SamProf
@adds39939 Thank you for message about broken website!
noamarbel
@noamarbel
Hello. Any smart ideas on how to display hierarchical data, like data in a JSON that is multi level? Basically a tree view, or a multi level expansion panel. Thanks.
darraghjones
@darraghjones
@page "/"
@using MatBlazor
<MatTextField ValueExpression="@(() => Total)"
              ValueChanged="@(t => UpdateTotal(t))"
              TValue="decimal"></MatTextField>
@code
{
    protected decimal Total => 5;
    protected void UpdateTotal(decimal t)    {    }
}
Surely this should show 5 in the text box? But the property getter isn't firing :/
Using MatBlazor Version="2.0.0"
darraghjones
@darraghjones
hmmm...or should I just be using Value instead of ValueExpression...?
noamarbel
@noamarbel
@darraghjones , you need to be a bit more specific. Do you actually want to do work in UpdateTotal()? or do you want the value of the text box to be reflected in Total?
And the issue is that since Total cannot be changed, and is fixed to 5, I suspect that the changed value gets updated back to 5 after a change.
Keith
@enkodellc
Hi @/all . Just merge Mark Stega's great PR for Blazor Boilerplate with MatBlazor that allows for both CSB and SSB. Hopefully this will help some of you out since you can quickly not Debug with SSB and then publish in CSB if you like. That is what I plan on doing!
yingwu88
@yingwu88
For a <MatTable>, how can I add a "Total" row? I tried to add another <MatTableRow> to the same MatTable, but the page will only show the last <MatTableRow>. Thank you.
yingwu88
@yingwu88
I did see there's a "ShowFooter" attribute for <MatTable>, should I put the column total in the Footer? How should I use the "Footer"? Thank you.
xbpass
@xbpass
Hi All. In latest version datepicker is localize. Which is bad obviously, I've stored my date
So...I stored my date in format I want, it shouldn't be localize...I don't see any option to be switched off, any idea how to solve ? Thanks :)
xbpass
@xbpass
This is server side
xbpass
@xbpass
You can put your template inside the footer just like you do with the header
@yingwu88 sry forget mention nickname...
Katie P
@katiep23
I have this inside of an EditForm & am getting error:
System.InvalidOperationException: MatBlazor.MatSelect`1[System.String] requires a value for the 'ValueExpression' parameter. Normally this is provided automatically when using 'bind-Value'.
<MatSelect Label="Rep Agency" Value="@projectParameters.RepNumber" TValue="string" ValueChanged="@((i)=>RepChanged(i))" Required="true">
HansM
@SeppPenner
@katiep23 First of all, you should either close your Select with /> or with another </MatSelect>... But it should work like that: https://blazorfiddle.com/s/jy8u08so
Dino Novak
@dnovak_gitlab
<MatSelect> with <MatOption> and binding to column with null value? is there a way to handle it as it is breaking with error?
Dino Novak
@dnovak_gitlab
<MatSelect> is there a way to define width?
HansM
@SeppPenner
@dnovak_gitlab I have the same issue now with the MatCheckbox...
@katiep23 Another thought: Is your rep number maybe null?
Dino Novak
@dnovak_gitlab
wondering if regex expression could help?
HansM
@SeppPenner
@SamProf The website under https://www.matblazor.com/Select is somehow broken + it throws errors once you select something in the Select component.
HansM
@SeppPenner
@katiep23 Strange. It works on the fiddle: https://blazorfiddle.com/s/tfgv8x16
John
@JohnKenedy1984_twitter
thanks matblazor team, the UI is perfect for someone who is not good in design
can someone point me out how to deploy matblazor as cordova app? i cant make it work because cordova cannot load fiile with underscore
Igal
@igalfsg
Can someone point me to how to use MatTooltip inside an editForm? I fixed the child context issue by adding <ChildContent Context="editContext"> under the edit form but now I am getting "Microsoft.JSInterop.JSException: Object doesn't support property or method 'addEventListener' TypeError: Object doesn't support property or method 'addEventListener'" when running the code and the tooltip doesnt show up.
Ryanlewis2010
@Ryanlewis2010
Hey am i an idiot or there not a way to change the color of the form fields? i have set the primary and secondary themes but on focus of a form field is defaulted to purple still.
Keith
@enkodellc
@Ryanlewis2010 Here is a CSS solution. Please donate to @SamProf or me -> https://www.paypal.me/enkodellc for MatBlazor and support

.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label {
color: green !important;
}
.mdc-floating-label {
color: orange !important;
}

.mdc-text-field .mdc-line-ripple {
background-color: Red !important;
}

Ricardo Pacheco
@rcpacheco
What is the recomended way to have an input type color, to choose colors ? I tried the string MatTextField with Type="color", but does not looks that nice