Styles (stylenames) do not work when the editor is databound

  • The following code does not work when the editor's DataBindings Text property is bound to a datasource - datafield.

    Assuming the Style Name xxx is properly defined.

    Memo.CurrPar.ClearCharAttr();
    Memo.CurrPar.StyleName = "Style Name xxx";
    Memo.ReformatAll(true, true);

    After i clear the databinding, setting the style works again !

    What should i do to make this work ?
    I cannot use the editor in unbound mode since with ADO.net there is no way of knowing, that i know of, when the record changes to save the text.

    Thanks again,
    Richard

    • Offizieller Beitrag

    Hi,

    the problem is that CurrPar... will not make sure the text is marked to be modified. This cannot be fixed internally, you need to make sure the internal "Changing" method is triggered.

    Please try

    TextCursor.CheckState(7) // WPSTAT_CANEDIT

    I hope this helps,

    Julian