Programatic FluentComboBox in C#? #212
-
Sorry, very newbie question. How do I generate the FluentOption values at runtime? `
` |
Beta Was this translation helpful? Give feedback.
Answered by
vnbaaij
Sep 2, 2022
Replies: 2 comments 4 replies
-
Hi,
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vnbaaij
-
Thanks, but what namespace is “Option” in?
e.g.
@using Microsoft.Fast.Components.FluentUI;
<snip>
List<Option<int>> GetRegions = new>();
does not compile.
Tim Hoffmann
Sr. Software Engineer
(231) 252-1202
FM:Systems
From: Vincent Baaij ***@***.***>
Sent: Friday, September 2, 2022 7:29 AM
To: microsoft/fast-blazor ***@***.***>
Cc: Timothy Hoffmann ***@***.***>; Author ***@***.***>
Subject: Re: [microsoft/fast-blazor] Programatic FluentComboBox in C#? (Discussion #212)
Hi,
You can do it like this:
<h2>From list of string items</h2>
<FluentCombobox ***@***.*** />
<h2>From list of int items</h2>
<FluentCombobox ***@***.*** />
@code{
List<Option<string>> stringOptions = new()
{
{ new Option<string> { Key = "1", Value = "One" } },
{ new Option<string> { Key = "2", Value = "Two", Selected = true } },
{ new Option<string> { Key = "3", Value = "Three" } }
};
List<Option<int>> intOptions = new()
{
{ new Option<int> { Key = 1, Value = 1, Disabled = true } },
{ new Option<int> { Key = 2, Value = 2 } },
{ new Option<int> { Key = 3, Value = 3 } }
};
}
—
Reply to this email directly, view it on GitHub<#212 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGZZJP3F75DG6D7GJLWA3ZDV4HXH3ANCNFSM57TWLWOA>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
You can do it like this: