Skip to content

docs(DropDownList): Change basic usage to live example #3121

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions components/dropdownlist/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,7 @@ The Blazor DropDownList component allows the user to choose an option from a pre

>caption DropDownList [data binding](slug:components/dropdownlist/databind), two-way value binding, and main features

````RAZOR
Selected value: @selectedValue
<br />

<TelerikDropDownList Data="@myDdlData" TextField="MyTextField" ValueField="MyValueField" @bind-Value="selectedValue">
</TelerikDropDownList>

@code {
//in a real case, the model is usually in a separate file
//the model type and value field type must be provided to the dropdpownlist
public class MyDdlModel
{
public int MyValueField { get; set; }
public string MyTextField { get; set; }
}

int selectedValue { get; set; } = 3;

IEnumerable<MyDdlModel> myDdlData = Enumerable.Range(1, 20).Select(x => new MyDdlModel { MyTextField = "item " + x, MyValueField = x });
}
````

>caption The rendered DropDownList component from the code snippet above:

![Blazor DropDown List component](images/dropdownlist-basic-screenshot.jpg)
<demo metaUrl="client/dropdownlist/overview/" height="380"></demo>

## Data Binding

Expand Down