Dynamically set datagrid column format via binding

how can I make this working?


I have a DataGrid in maui with the following column defined:

                            <syncfusion:DataGridDateColumn MappingName="Time" Format="{Binding TimeFormat, Mode=TwoWay}"/>


in the ViewModel i have defined a OObserveableProperty for the format:

[ObservableProperty]
private string _timeFormat ="yyyy";


and then when I click a button i want to change the format from "yyyy" to "MM.yyyy" for example

like this:

            TimeFormat = "MM.yyyy";


is that possible? where did i go wrong?


3 Replies

KK Karthikraja Kalaimani Syncfusion Team September 26, 2022 11:51 AM UTC

Hi Andreas, 


Currently, we are validating your requirement. So, we will validate and update the further details on or before 28th Sep 2022. We appreciate your patience until then. 

Regards,
Karthik Raja



KK Karthikraja Kalaimani Syncfusion Team September 29, 2022 12:25 PM UTC

Hi Andreas, 


Currently the DataGrid don't have runtime changes support for Format property of DataGridColumn. We have considered your requirement as feature and logged feature request for the same. We will include the feature in our upcoming 2022 Volume 3 SP release which is scheduled on mid of November 2022. We appreciate your patience until then. 


You can track the status of this report through the following feedback link,

https://www.syncfusion.com/feedback/38079/support-to-change-the-format-property-of-datagridcolumn-dynamically

Regards,

Karthik Raja



KK Karthikraja Kalaimani Syncfusion Team November 9, 2022 09:03 AM UTC

We are glad to announce that our Essential Studio 2022 Volume 3 Service Pack Release V20.3.0.56 is rolled out with "Provide the support to change the format of the columns by changing the Format property of DataGridColumn dynamically" feature and it is available for download under the following link.


https://www.syncfusion.com/forums/178709/essential-studio-2022-volume-3-service-pack-release-v20-3-0-56-is-available-for-download


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Loader.
Up arrow icon