Print Page | Close Window

GridBuilder

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=633
Printed Date: 23-Oct-2025 at 3:47pm


Topic: GridBuilder
Posted By: vkh75
Subject: GridBuilder
Date Posted: 25-Dec-2007 at 8:12am
I've read the "Visual Grid Designer Dangers" tech tip and I liked the way of customizing a DataGridView discussed there. But I'm a bit confused of how I can involve the technic in my existing application (Windows application and DevForce Express). Any suggestions?
 
Thanks!



Replies:
Posted By: GregD
Date Posted: 27-Dec-2007 at 11:09am
The author of that tech tip, Ward Bell, is on holiday vacation so I can't ask him directly if he has any examples. However, a good guess would be that the only examples he has at the ready are integrated into his Cabana application. That is a very complex app involving the integration of Microsof't Composite UI Application block with DevForce, and as such isn't a particularly good place to go hunting for sample code. Easy to get lost in the forest.
 
I would suggest an exploratory approach like the following:
 
1. Create a brand new (empty) Windows form
2. Make a copy of it in the same project, changing the name as necessary to prevent duplications.
3. On one of the two copies, use the DevForce DataGridViewBindingManager designer to wire up a grid of modest complexity.
4. Inspect the code generated into the .Designer.cs file by the DataGridViewBindingManager designer.
5. Extract all necessary code generated from the .Designer.cs file by the DataGridViewBindingManager designer into the main form file, thereby taking control of it.
6. Refactor and arrange the extracted code into convenient, nicely encapsulated methods.  Experiment with different kinds of parameters that permit you to pass in the columns to be displayed along with other settings (such as Editability, etc.)
 
You will need to be familiar with the DevForce DataBinding facilities, including DataConverters and possibly ViewDescriptors, to get very far with your experiments.  You can learn about these in the Developers Guide and in following Instructional Units:
 
100 series
 
UI Overview (powerpoints only - you'll need to download from the Learning Materials page on the web site)
 
 
200 series
 
DataConverters And ViewDescriptors
 
 
The PowerPoints for the latter may also be helpful. We don't ship the PowerPoints with the product because they make the installation executable too big, but you can download these from the Learning Materials page.  The code solutions for the DataConverters And ViewDescriptors unit are shipped with the product. See Tutorials on the Windows menu for IdeaBlade DevForce.
 
Greg Dunn
 
 


Posted By: vkh75
Date Posted: 27-Dec-2007 at 11:00pm
Thank you, Greg! I'll try what you suggest.
I thought I could just copy a couple of classes from Cabana to my project and that would be enough, but it seems not.


Posted By: GregD
Date Posted: 28-Dec-2007 at 9:18am
Welcome.
 
I forgot to mention: the point of copying the empty form is to make a base of comparison for the second form after you let the BindingManager designer generate code into it.  Makes it easier to see what the designer generated.
 
Cheers.



Print Page | Close Window