How to remove the X from the edit box

Hi, how can I remove the X when editing a current cell in a text column? It does not appear if the column is set to numeric, but if the column is the standard text one, I get the X on the right of the edit box and it covers the current entered value.

It actually appears to be almost random, sometimes the text column will have the X and sometimes it won't.


1 Reply

NY Nirmalkumar Yuvaraj Syncfusion Team April 11, 2024 06:00 AM UTC

Hi Phunction,


This is a known issue on our end, and we plan to address it in one of our upcoming releases. In the meantime, we've prepared a workaround for you. You can override the DataGridTextBoxRenderer and implement the OnCreateEditUIView() method. Then, wire the 'handlerchanged' event of the edit element. Within this event, set the text wrapping to wrap on the Windows platform. We hope this solution meets your requirements. For your convenience, we have attached a sample, image, and code snippet for your reference. Thank you for your patience and understanding.

Code snippet:

        private void Entry_HandlerChanged(object? sender, EventArgs e)

        {

            var editElement = (sender as SfDataGridEntry);

#if WINDOWS

            if(editElement!.Handler!= null && editElement.Handler?.PlatformView is Microsoft.UI.Xaml.Controls.TextBox windowEntry)

            windowEntry.TextWrapping = Microsoft.UI.Xaml.TextWrapping.Wrap;

#endif

        }


Regards,

Nirmalkumar


Attachment: SfDataGrid_sample_b87cf2f0.zip

Loader.
Up arrow icon