Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Designer to Define Grids
Message
 
 
À
01/02/2010 07:51:25
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01446780
Message ID:
01446885
Vues:
28
>>Hi,
>>
>>I am trying to set up what columns are to be displayed in the grid (datagridview) - instead of all - but not getting something.
>>
>>First, when I set up the grid DataSource to the Binding sourse, the grid show all columns in the table. Here is how I was doing it in code:
>>
>> grid.DataSource = ProjectsBindingSource;
>>
>>
>>But this is not what I want. I want only certain columns to be in the grid.
>>
>>So in the designer I click on the Smart Tag which opens the window where I can specify the Data Source. I set the data source to the data source ProjectBindingSource in the DataGridView Tasks. Then in the same list of tasks I click on Edit Columns. And I thought I would see the columns in the Data Source but nothing is shown. So basically I can't see a way to specify which column of the grid should take the column in the Data Source.
>>
>>What am I missing?
>>
>>TIA.
>
>Are you sure that you didn't set your datasource to a dataset rather than a datatable or alike? Edit columns would show columns when there is a specific source.
>Cetin

In my class code I have the following statement:
ProjectBindingSource.DataSource =  dsMyDataSet.dtMyDataTable;
So it looks from the above that the data source is set to a datatable. And this is what I used in the grid data source (in designer), ProjectBindingSource. And yet I see no columns of the table dtMyDataTable. I guess I must be missing some step or something. Please let me know if you see what it is.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform