I have a datagrid, with some cell's templets set to set to be read-only TextArea controls. Unfortunately on mouseovers with these TextAreas the mouse cursor still changes into an input cursor, even though they're read-only.
I've used my browser's developer tools to try to find the CSS that's changing this, but no luck - I'm kind of a noob. Is this even necessary? Can't I add an attribute to the TextArea to override or something?
Any hints from my favorite peeps (@Thomas & @kim) would be most appreciated...
You can easily change the cursor in the component style. However Radzen already has its own use of the style attribute, so you can't add another style attribute manually. But you can add another item to the current style, by overwriting an existing property. Here's an example with the Width property, but this can be done using any other style property:
Strange, I see that the previous forum posts here also change the cursor to edit style - is that normal or some sort of standard? Perhaps so that you can select text for copying? Either way, it will confuse my end-users, so thank you very much. Owe you one
Hi all,
it were great if Radzen allows "merging" of the style attributes. Simply add an attribute in Radzen Designer and radzen should "add" or "replace" (if already there) while generating the blazor page. That can make a few things much handier. attributes are simple. split and join should do the job.
perhaps the radzen team will think about bringing in this feature?
I am not @Thomas or @kim but I know why this happens. This is the default cursor all browsers display for a <textarea> element. I have two questions for you:
Why are you using a readonly textbox in your template? Readonly textboxes are very confusing as they look exactly as enabled ones and users expect to be able to type in them. Changing the cursor with CSS will not improve things a lot. This is bad user experience in my opinion.
If you must use textboxes why not disabled ones instead of readonly? Users are familiar with it and know that they can't type in a disabled textarea.
Or perhaps using a label component? does labels show crlf's correct?
Only an idea... not tested
Thomas
PS: @korchev
What do you think about the "attribute merging"? I think its better than using "; cursor:point" in the width attribute or similiar constructs.
I think @Thomas is talking about adding an existing attribute, but Radzen figuring out that it already exists, thus only appending the attribute value. Here's an example:
Right now Radzen simply adds the attribute and causes the duplicity error shown above. It could also overwrite attributes that only have one value, such as MaxLength for example:
Yes. When...
there is a style attribute e.g. style="width:100px; height:200px" that is generated by radzen.
Then someone creates an attribute i radzen designer
Name:"style" Value:"font-size:14px"
Now... when radzen generates the page... the generator looks in the generated styles... found names "width:100px" & "height:200px" ( split";") and "adds" "; " and the "font-size:14px" attribute to "style=".
So we have style="width:100px; height:200px; font-size:14px"
No duplicate "style"... all fine.
@korchev I'm using a read only textarea because I'm trying to emulate an existing spreadsheet with the datagrid. The spreadsheet's rows have cells that contain multiple lines of wrapped text that users need to scroll through and quickly examine. Multiple lines are a must, and I think the read only textarea is nearly perfect. Its really cool how it scrolls or can be pulled down with the mouse by an end user to expose more lines of text. Setting their border colors to light grey makes it fit in well. A disabled textarea looks out of place here in my opinion.
Below are three textareas. 1st is disabled and pulled down. 2nd is enabled, read only and pulled down. 3rd is read only, not pulled down.
While the mouse cursor on the disabled textarea is what I'm looking for, (and I'm surprised to see that it can still scroll and be pulled down), the greyed background and text are more difficult to read and look out of place...to me. I suppose the grey stuff could be fixed with some css, but I don't see any point. Are there any advantages to disabled over read only?
I may experiment with using a text box or label instead of the text area, but will they scroll and pull down also? Ideally, I'd rather not have to use template for these cells at all if there's a way to display multiple lines with word wrap, but again scrolling & pulldown?
And for what it's worth, I'm really looking forward to replacing these textareas with the hopefully coming soon WYSIWYG editor on the add & edit forms.
OK, so after some testing there seems to be problems when having a style too long. I made an app from scratch and did the same and couldn't reproduce, as you guys probably did aswell. Then I copied the whole style from my old project and the problem occurred.
Basically, prepend the code below to the style attribute right before the binded attribute: