Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: FluentSelect not show fully in TemplateColumn #1579

Closed
kamazheng opened this issue Feb 27, 2024 · 3 comments
Closed

fix: FluentSelect not show fully in TemplateColumn #1579

kamazheng opened this issue Feb 27, 2024 · 3 comments

Comments

@kamazheng
Copy link

<FluentDataGrid id="defaultGrid" Items=RowsGrid.AsQueryable() GridTemplateColumns="1fr 1fr 1fr" TGridItem=SampleGridData>
    <TemplateColumn Title="Name">
        <FluentTextField @bind-Value="@context!.Name" />
    </TemplateColumn>
    <TemplateColumn Title="Age">
        <FluentNumberField @bind-Value="@context!.Age" TValue="int" />
    </TemplateColumn>
    <TemplateColumn Title="Select">
        <FluentSelect  TOption="string" Height="300px" Open="true">
            <FluentOption Value="AL">Alabama</FluentOption>
            <FluentOption Value="AK">Alaska</FluentOption>
            <FluentOption Value="AZ">Arizona</FluentOption>
            <FluentOption Value="AR">Arkansas</FluentOption>
            <FluentOption Value="CA">California</FluentOption>
            <FluentOption Value="CO">Colorado</FluentOption>
            <FluentOption Value="CT">Connecticut</FluentOption>
            <FluentOption Value="DE">Delaware</FluentOption>
            <FluentOption Value="FL">Florida</FluentOption>
        </FluentSelect>
    </TemplateColumn>
</FluentDataGrid>


@code {
    public class SampleGridData
    {
        public string Name { get; set; }
        public int Age { get; set; }
        string? selectValue;

        public SampleGridData(string name, int age)
        {
            Name = name;
            Age = age;
        }
    }

    List<SampleGridData> RowsGrid = new()
    {
        new SampleGridData("Rob", 19 ),
        new SampleGridData("Bob", 20 )
    };
}

image

@vnbaaij
Copy link
Collaborator

vnbaaij commented Feb 27, 2024

Thisis a know issue/limitation. See #217 for possible workarounds

@vnbaaij vnbaaij closed this as completed Feb 27, 2024
@ARiSoul
Copy link

ARiSoul commented Mar 10, 2024

I was also struggling with this, no workaround was solving the problem, maybe my fault, since I'm a newbie in Blazor, I don't know... But since I was struggling so much, and I found a very simple workaround that just works for me that is not mentioned anywhere, I thought about leaving it here, since it may help someone sometime. I just used inline Style="position:absolute;" and it worked... For me, it's more than enought, since this only happens once or twice in the application...

Full declaration:

<TemplateColumn Title="@Loc["Type"]" Context="product">
    <FluentSelect TOption="ProductType"
        Items="@_productTypes"
        OptionText="@(i => i.Name)"
        OptionValue="@(i => i.ID.ToString())"
        @bind-SelectedOption="@product.ProductType"
        Style="position:absolute;"/>
</TemplateColumn>

@kamazheng
Copy link
Author

Below solution works for me, just add below style for TemplateColumn:

Style="overflow:visible"

Style="position:absolute;" not worked as expected, the position of FluentSelect is not stick to its right position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants