Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
UltraGrid Cell TextHAlign is not working on Mouse Hover
posted

We are using UltraGrid, and on it we have applied some styling from .isl file. With that we have set TextHAlign="Left". But in the form we want to use TextHAlign="Center" for one column. We are achieving it by using below code in IntializeRow(object sender, InitializeRowEventArgs e) event. But once we mouse hover on this Cell, the Aligment is set to Left.

e.Row.Cells["MyColumn"].Appearance.TextHAlign = Infragistics.Win.HAlign.Center;

Please suggest the way how can we do it.

Screenshot:

Parents
No Data
Reply
  • 2680
    Offline posted

    Hello Narendra,

    Thank you for posting to Infragistics Community!

    I have been looking into your question and created a small sample with an UltraGrid of version 19.2 of Ultimate UI for WinForms as stated in the details of this case. The project loads an Infragistics Style File, containing a style, setting the GridCell role’s Normal state textHAlign property to “Left”. Then, as described by you, one of the columns’ TextHAlign is set n the InitializeRow event to HAlign.Center. However, I am only assuming that the style file is targeting the GridCell role. If this is not the case, please provide more details on how this is achieved.

    On my side, everything works as expected and the overwritten alignment is persisted on hover. As the isolated sample shows the described features working correctly, this indicates that the issue is most probably local to your own project. Currently, I cannot tell for sure what may be causing this in your app, however, please make sure that the style file is not setting the alignment for the “HotTrakced” state of the GridCell as well.

    In conclusion, please test the below attached sample on your side and let me know how it behaves.

    Best regards,
    Bozhidara Pachilova
    Associate Software Developer

    0160.UGCellAlignment.zip

Children