|
<SfTextBox Multiline="true" Placeholder="Enter the Name" HtmlAttributes="@htmlAttribute"></SfTextBox>
@code{
private Dictionary<string, object> htmlAttribute = new Dictionary<string, object>()
{
{"rows", "5" }
};
} |
Adding the attribute directly works too ...
<SfTextBox Rows=5 Multiline="true" Placeholder="Enter the Name"></SfTextBox>
Greetings to Syncfusion support.
I am using SyncFusion.Blazor v26.1.35, I need a textbox with multiline and set number of rows to control of height of component .
I used these 2 ways :
<SfTextBox Width="200px"
Multiline="true"
Type="InputType.Text"
HtmlAttributes="@htmlattribute" />
@code {
Dictionary<string, object> htmlattribute = new Dictionary<string, object>()
{
{ "maxlength", "256" }, //it works
{ "rows", "3" }, //it doesn't works
};
}
Hi ali,
We have tested setting rows for the multiline textbox through HtmlAttributes, and it is working properly on our end. Please find the attached sample for your reference.
Sample: https://blazorplayground.syncfusion.com/LtLfZPtOeNhmnbhW
To assist you better, could you please share the version details you are using? Additionally, we would like to inform you that starting from version 26.1.35, we have implemented a separate TextArea component. For more information, please refer to the following documentation and demos:
Regards,
Priyanka K
Hi Priyanka,
Thank you for your quick reply. It was my mistake that I had given height to text box in the app.css file.
I had another question, is there a way to keep its height fixed in multi-line mode?
If you want to set a fixed height for the TextBox Multi-line mode, you can do so using the CssClass property. Below is a code snippet and a sample link for your reference:
<SfTextBox ID="login" Multiline="true" CssClass="text-multiline" /> <style> .text-multiline textarea{ height: 300px !important; } </style> |
Sample: https://blazorplayground.syncfusion.com/VXLJXbCeTVUCKmzv
Priyanka K
Hi Priyanka
I ran your example and it was exactly what I was looking for, thank you for your correct and quick answer.
Hi ali,
Thank you for the update. Please get back to us if you need any further assistance.
Regards,
Priyanka K