Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Example of using DataGrid
Message
 
To
27/09/2002 12:21:00
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00705302
Message ID:
00705311
Views:
8
What are you binding to the DataGrid, a DataTable or a DataView? You want to set the MappingName to the name of the DataTable EVEN if you are binding to a DataView object. The text you place in the MappingName should only be the name of the table like "MyDataTable". If the MappingName field is incorrect, then you will get all the fields to display in the grid instead of only the ones you want.

>Is there an example of using the DataGrid in .Net?
>
>I have a WinForm that I created in C# and placed a DataGrid in the form. The DataGrid works but every field from my table is displayed in the form.
>
>I tried filling in the properties from the TableStyles collection and placed the DB object name in the MappingName. I then go to the GridColumnStyles collection and add 2 fields, etc...
>
>But when I run this form, every field displays in the grid. Not just the 2 I defined.
>
>What am I missing? Is there a C# example of making the DataGrid work?
>
>Thanks,
>
>Jerryt
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform