Hi Sebastian Kowalewski,
Based on the information provided, it appears that you are trying to bind the Discount object to a GridTemplateColumn, but are encountering an issue where the ValueBinding in the TemplateSelector returns null.
Upon reviewing your code snippet, we noticed that you have attempted to bind the Discount object through the ViewModel. However, since you mentioned that the Discount object resides within the ShoppingObject class, it is crucial to correctly configure the DisplayBinding path to access the Discount object. The binding operates based on the DataContext of the GridCell. If the bound property (Discount) is part of the Shopping Object class, the value will be retrieved; otherwise, it will return null.
We recommend ensuring that both the DisplayBinding and ValueBinding are correctly set with the appropriate path. This will guarantee that the values are accurately bound and displayed. To further assist you, we have prepared a sample demonstrating this approach. Please review it and let us know if it aligns with your requirements.
If we have misunderstood your request or if your needs differ, kindly provide additional details regarding the issue you are facing. This will enable us to better understand the problem and offer a suitable solution.
Thank you for your understanding and cooperation.
Regards,
Malini Selvarasu
Attachment:
SfDataGrid_Demo_6de82af7.zip