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
163
Removing Mask from DateTime Column
posted

I have a situation in code where there is a column in grid whose DataType is set to DateTime. Now I only have to display the Date Part in the format "dd/MM/yyyy" for which I have set the column style to DateWithOutDropDown as I don't have to display the Dropdown calendar control. I did so in the grid's Initialize Layout event by checking the Column's Data Type. Further for your information I didn't set the MastInput for the column.

Now the cell editor in edit mode displays the masking like "__/__/____". My problem is that I want to hide this editor masking and need to display only the plain text editor where the user could enter the date in any format of his/her choice.

 

Due Regards,

Talha Muhammad

Parents
No Data
Reply
  • 419
    posted

    The following properties on the columns have to be set in the Iniotialize Layout

    1)  e.Layout.Bands[0].Columns["Date"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Date;

     This line makes sure that only the date part is shown.

    2)  e.Layout.Bands[0].Columns["Date"].ButtonDisplayStyle = ButtonDisplayStyle.OnCellActivate;

    this line makes sure that the calendar button is displayed only on cell activate.

Children
No Data