Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146769 | Aug 19,2019 09:01 AM UTC | Aug 20,2019 11:57 AM UTC | Blazor | 1 |
![]() |
Tags: ListBox |
<EjsListBox Value=@Value DataSource="@Data" TValue="string[]" @ref="CustomListBox"></EjsListBox>
<EjsButton CssClass="e-flat" IsToggle="true" IsPrimary="true" Content="@Content" @ref="ToggleButton" onclick="OnToggleClick"></EjsButton>
<style>
.e-custom-hide{
display:none;
}
</style>
@code{
public string[] Value = new string[] { "Hennessey Venom" };
public List<object> Data = new List<object>
{
new { text = "Hennessey Venom", id = "list-01" },
..//
};
EjsButton ToggleButton;
EjsListBox<string[]> CustomListBox;
public string Content = "Hide";
public void OnToggleClick(UIMouseEventArgs args)
{
if (ToggleButton.Content == "Hide")
{
this.Content = "Show";
CustomListBox.CssClass = "e-custom-hide"; // To hide the ListBox based on the Button text
}
else
{
this.Content = "Hide";
CustomListBox.CssClass = ""; // To show the ListBox based on the Button text
}
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.