| Author |
Message |
woody
Joined: 15 May 2012 Posts: 2
|
Posted: Tue May 15, 2012 10:41 pm Post subject: Issue with "BindingList" as DataSource for Gridview |
|
|
Hello,
I am using Smart Assembly 6.6.4.95 with DevExpress. I have run into occasional problems with "Pruning" and thought maybe I should start posting them. I often use BindingList<T> as the DataSource for a DevExpress GridView to provide users with a quick view to data objects, using the following code:
BindingList<MyDataObject> gridBatchDataList = new BindingList<MyDataObject>();
gridControl1.DataSource = gridBatchDataList;
With "Pruning" enabled all the data is lost, and the gridview displays only one column with the object name repeated on each row. If this is not enough detail and you need a sample project, please let me know where to send it.
Best regards,
Woody |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6369 Location: Red Gate Software
|
Posted: Wed May 16, 2012 1:36 pm Post subject: |
|
|
I don't think it's practical to plumb in exclusions for every case where pruning will break a program, and we cannot know when code will be invoked outside of the normal .NET rules, like Microsoft's WPF and DevExpress components do. So this is not a "bug" that can be fixed really...
What I usually do is debug, try to find the name of the type that can't be accessed, and exclude that manually from pruning. I appreciate that this may be really difficult to do, but unfortunately it will be impossible to make SA produce assemblies that "just work" if vendors are invoking private members across DLLs and other such things they're not supposed to do. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
woody
Joined: 15 May 2012 Posts: 2
|
Posted: Thu May 17, 2012 12:56 am Post subject: |
|
|
Hi Brian,
Sorry, I should have mentioned that this is an issue with the standard Visual Studio 2010 dataGridView as well:
BindingList<MyDataObject> gridBatchDataList = new BindingList<MyDataObject>();
dataGridView.DataSource = gridBatchDataList;
Not doing anything special here.
Best regards,
Woody |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6369 Location: Red Gate Software
|
Posted: Thu May 17, 2012 9:45 am Post subject: |
|
|
Hi Woody,
I can't reproduce your issue with the datagrid. I suspect it almost has to be a serialization problem, as this is what SmartAssembly most commonly breaks. You may want to apply the Serializable attribute to your MyDataObject class to make sure it doesn't get pruned. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group