We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can't Change TextColor In DataFormMultiLineTextEditor

Syncfusion Support,

I have the following code:

public class CustomMultilineTextEditor : DataFormMultiLineTextEditor
    {
        public CustomMultilineTextEditor(SfDataForm form) : base(form)
        {
           
        }

        protected override void OnInitializeView(DataFormItem dataFormItem, Editor view)
        {
            view.TextColor = Color.White;
            view.PlaceholderColor = Color.LightGray;
            dataFormItem.UnfocusedColor = Color.FromHex("#FF7E92A4");
            dataFormItem.FocusedColor = Color.FromHex("#FF408698");
            base.OnInitializeView(dataFormItem, view);
        }
    }

Every aspect of this is working except for the TextColor.  The TextColor remains black for some reason.  Is there any way to fix this, possibly a different property specific to DataFormMultiLineTextEditor?

Using v17.4.0.44 of SyncFusion.Xamarin.SfDataForm, 4.4.0.991537 of Xamarin.Forms.

Thanks,

Kyle

9 Replies

KA Karthikraja Arumugam Syncfusion Team January 27, 2020 08:35 AM UTC

Hi Kyle, 
 
Thank you for contacting Syncfusion support. 
 
Based on the shared information we have checked your requirement of “Changing TextColor of multiline text editor using custom editor”. TextColor for multiline text editor is set in base OnInitializeView method so the color reset in base method. You can achieve your requirement by changing TextColor for editor view after base method call in OnInitializeView method. 
 
Please refer the following code example for the same, 
 
public class CustomMultilineTextEditor : DataFormMultiLineTextEditor 
{ 
        public CustomMultilineTextEditor(SfDataForm form) : base(form) 
        { 
 
        } 
 
        protected override void OnInitializeView(DataFormItem dataFormItem, Editor view) 
        { 
            view.PlaceholderColor = Color.Blue; 
            dataFormItem.UnfocusedColor = Color.FromHex("#FF7E92A4"); 
            dataFormItem.FocusedColor = Color.FromHex("#FF408698"); 
            base.OnInitializeView(dataFormItem, view); 
            view.TextColor = Color.Red; 
        } 
} 
 
 
We have prepared a sample based on your requirement, 
 
We hope this helps. Please let us know if you require any further assistance. 
 
Regards, 
Karthik Raja A 



JJ Jeff Jacobs January 27, 2020 02:28 PM UTC

Karthik,

Thank you very much for the response.  I apologize, as there was apparently a vital detail I left out.

In your sample application, if you change:

x:Name="dataForm" LayoutOptions="Default" 
                             DataObject="{Binding Contacts}"/>
To:
x:Name="dataForm" ContainerType="Outlined" LayoutOptions="TextInputLayout"
                             DataObject="{Binding Contacts}"/>

(I apologize I can't include the full line, buggy behavior in the form text editor.

It breaks the functionality in question.  I'm not sure whether it's the ContainerType or the LayoutOptions, because it seems you can't have one without the other for the Outlined ContainerType to work properly.

Also notice how all of the other properties (FocusedColor, UnfocusedColor, PlaceholderColor) don't seem to be working at all in your sample, no matter if they're before the base.OnInitializeView or after.



Whereas all of the properties work EXCEPT for text when you use Outlined mode.



KA Karthikraja Arumugam Syncfusion Team January 28, 2020 01:21 PM UTC

Hi Kyle, 
 
Thank you for the update. 
 
We have analyzed and able to replicate the mentioned issue “MultilineText editor TextColor cannot be changed in Floating label layout”. We are checking the same with source and sample level. We will validate and update you the further details in two business days (January 30, 2020). We appreciate your patience until then. 
 
Regards,
Karthik Raja A 



JJ Jeff Jacobs January 28, 2020 01:23 PM UTC

Karthik,

Thank you for the response  That's wonderful, thanks for looking into this and I'll look forward to your findings.

Kyle


KA Karthikraja Arumugam Syncfusion Team January 29, 2020 12:51 PM UTC

Hi Kyle, 
 
Thank you for the update. 
 
As we have mentioned in our previous update, we are checking the mentioned issue in source level we will update your further details on January 30, 2020. We appreciate your patience until then. 
 
Regards, 
Karthik Raja A 



KA Karthikraja Arumugam Syncfusion Team January 30, 2020 12:47 PM UTC

Hi Kyle, 
 
Thank you for your patience. 
 
We have already found and fixed the mentioned issue “MultilineText editor’s TextColor cannot be changed in floating label layout” in our source, we will include the issue fix in our upcoming Weekly nuget release which is expected to roll out on February 5, 2020. We appreciate your patience until then. 
 
Regards, 
Karthik Raja A 



JJ Jeff Jacobs January 31, 2020 06:02 PM UTC

Karthik,

Fantastic, that's awesome.  Thank you for your work and validating my decision to go with SyncFusion!


KA Karthikraja Arumugam Syncfusion Team February 3, 2020 07:27 AM UTC

Hi Kyle, 
 
Thank you for the update. 
 
As mentioned in our previous update we will include the issue fix in our upcoming Weekly nuget release which is scheduled on February 5, 2020. We appreciate your patience until then. 
 
Regards, 
Karthik Raja A 



KA Karthikraja Arumugam Syncfusion Team February 6, 2020 01:59 AM UTC

Hi Kyle,                    
      
We have fixed the reported issue “MultilineText editor’s TextColor cannot be changed in floating label layout” and included the issue fix in our latest Weekly NuGet release update version 17.4.0.47 which is available for download (nuget.org).

 
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Karthik Raja A   


Loader.
Live Chat Icon For mobile
Up arrow icon