I am using a Modern form control for updating Training records. I have a record with all the information filled out and there is a date value in the Training date column for this record too. When the form is in the ViewForm mode; the DataCardValue_TrainDate shows the date value. Now, since I don't want the users to change the Training date so the DataCardValue_TrainDate.DisplayMode = DisplayMode.View. When I modify the Form = EditForm, the value in DataCardValue_TrainDate = Blank and the datacard is in ViewMode.
I want the DataCardValue_TrainDate to show the date irrespective of the FormMode. How can I do that? I have shared images below (FormMode_View and FormMode_Edit).
FormMode_Edit.png
FormMode_View.png
Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.
This usually happens with the Modern Date Picker control inside a modern form. When the form switches to FormMode.Edit, the control expects a value from the card’s Default / DefaultDate property, but since the control itself is in DisplayMode.View, it sometimes stops binding correctly and shows Blank(). Try the following approach. Set the DefaultSelectedDate (or Value depending on the modern control version) of DataCardValue_TrainDate explicitly to the existing item value. Example: ThisItem.'Training Date' Then keep: DataCardValue_TrainDate.DisplayMode = DisplayMode.View. This ensures the form is in Edit mode. Users cannot edit the field.Existing date still displays properly
🏷️Please tag me @Kushal_M,if you still have any queries related to the solution or issue persists.
❤️Please consider giving it a Like, If the approach was useful in other ways.
✅Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.