Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with data binding for grid
Message
De
26/06/2008 18:03:40
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01326791
Message ID:
01327086
Vues:
14
Hi Linda,

OK, I see you must be working in Windows Forms. The mmDataGridView does not have the checkbox for AutoGenerateColumns, but you can still: select the mmDataGridView in design mode, then click the little arrow in the upper right corner and select "EditColumns" from the popup menu. After you get the columns form you can click the "Add" button and add a bound column to the grid. After you have added your columns, close the add column dialog and change the "DataPropertyName" property of each column to the fields you want to bind to.

Tim


>Thanks. I don't have the check box. I guess that's a 2008 enhancement. It has been a while since I worked on .NET and I have just started back on it recently. Either the mechanics of changing the fields changed or I have just forgotten what I figured out a year ago.
>
>I did find the code to put in the form code to turn off the autogenerate columns option in the JumpStart instructions. Am I correct in assuming that if I assign a field name as the DataPropertyName, it will become a bound column? The place to click on bound columns was disabled.
>Linda
>
>>Hi Linda,
>>
>>>I have a form with a DataGridView on it. I am able to select the business object to bind to the table but I am unable to edit the columns. When I pull up the edit columns option, none of the columns are displayed. I have done this successfully many times before and can't figure out what the problem is this time. Any ideas? Thanks.
>>
>>When you select the gridview object in design mode there is a smart tag in the upper right corner of th grid. Clicking on this will give you a pop up menu where you can edit columns. There will be none there but the bottom corner of this form has a checkbox that says something like AutoGenerate Columns. You can uncheck this, and then add the columns you want typically as Bound columns. Check out the jump start section where Kevin walks through Enhancing the grids.
>>
>>Hope that helps.
>>Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform