Dear Admin
I just use RadGridView control for excel content shown in MVVM pattern, and before amount excel data, I do not know exact columns and rows shown in RadGridView, so I use datatable as my datasource binded to RadGridView's ItemsSource. But actually I would like to change some columns datatype from string to Image, I try to add AutoGeneratingColumn event and set CellTemplate for specified columns, and the result was that there was no response after loading and only shut-down whole window.
so in this case is there any other workaround to archive similar case? any ideas I do really appreciate.
6 Answers, 1 is accepted
This is strange behavior. Are you using the DefaultView of the DataTable? If not, can you try it? I have attached a sample project which is similar to your requirement. Please give it a try and let me know if it helps.
Regards,
Yoan
Progress Telerik
Dear Yoan
I just tried it and worked well, but one more thing is image column information is different and I need to set binding for it, in my data template I just use column name as property path during instantiating binding, that issue occured. I'm sorry for my unclear description.
And if I use interaction behavior(generating GridViewDataColumn and GridViewImageColumn in code-behind dynamically and set binding column into custom columnsbindingbehavior implemented from Behvior<RadGridView>), result is OK but the issue is there were 10~30s no responding time. it is really strange.
Thanks for the additional info. We'll check it later and get back to you.
Regards,
Martin Ivanov
Progress Telerik
I have modified my project so it meets your scenario and it works as expected. May I ask you to check it and let me know if I am missing something? If this is the case, can you provide a code snippet which will help me to reproduce the problem?
Regards,
Yoan
Progress Telerik
Dear Yoan
Thanks a lot for your support, It works well. And I just tried to find out reason of my problem, I think it should be caused by finding resources , sometimes we code with MVVM pattern and use system.windows.application.current.TryToFindResource to get specified resource but result was error or null, and later I will attch a code snippet about no responding with interaction way.
I will close this thread for now. Please, do not hesitate to open it if you encounter any problems.
Regards,
Yoan
Progress Telerik