datagrid shows all dataset table column (win forms) 
Author Message
 datagrid shows all dataset table column (win forms)

Hi

My datagrid have datasource mapped to dataset with one table. Table contains
many columns but I don' want to display all of them in datagrid but only
two. In ASP.Net  I used 'property builder' to choose bounded column and I
couldn't show all fields of dataset table in grid. Is it possible in 'win
forms' datagrid?

Karol



Sun, 27 Mar 2005 22:08:14 GMT  
 datagrid shows all dataset table column (win forms)
Hi Karol,
You get the most control over the datagrid by using a DataGridTableStyle for
each table and DataGridColumnStyles for each column; that way you can
readily alter the order of columns and restrict the columns shown.

To add a TableStyle, click on the DataGrid properties window and find the
TableStyles property (marked collection), when you click this a button with
ellipses on it magically appears and this gets you into the TableStyles and
ColumnStyles collection editors. From here add a TableStyle, setting the
MappingName to your table name. Then in the TableStyle properties find the
GridColumnStyles property, again marked collection and again an ellipses
button appears when you click it, this gets you into the ColumnStyles
collection editor and now you add a columnstyle for each column you want to
display making sure you set the MappingName to the name of the column you
want to show.

Any columns you don't add in won't be shown and you can reorder the columns
while in design mode using the up/down arrows.

Hope that helps you a little

Jasmine
www.datagridcolumnstyles.net
Custom DataGridColumnStyles for the Microsoft .Net Windows Forms DataGrid


Quote:
> Hi

> My datagrid have datasource mapped to dataset with one table. Table
contains
> many columns but I don' want to display all of them in datagrid but only
> two. In ASP.Net  I used 'property builder' to choose bounded column and I
> couldn't show all fields of dataset table in grid. Is it possible in 'win
> forms' datagrid?

> Karol



Sun, 27 Mar 2005 22:56:38 GMT  
 datagrid shows all dataset table column (win forms)
i am not about application , but in web application using datagrid set this
attribute
 AutoGenerateColumns="False"
i am sure there is one in window application


Quote:
> Hi

> My datagrid have datasource mapped to dataset with one table. Table
contains
> many columns but I don' want to display all of them in datagrid but only
> two. In ASP.Net  I used 'property builder' to choose bounded column and I
> couldn't show all fields of dataset table in grid. Is it possible in 'win
> forms' datagrid?

> Karol



Mon, 28 Mar 2005 16:34:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Can DataGrid show DataSet as tree style?

2. Adding a new virtual/temporary column to different tables via a DataSet

3. Datagrid to show dataset

4. Datagrid containing a column showing an icon

5. get the names of the columns in my datagrid header (windows forms)

6. HowTo? Binding DataSet tables.columns to form.textboxes and form.comboboxes

7. Showing related data from different tables in the same datagrid

8. MS Database Designer dont show table column

9. Getting cell data from DataGrid (win form)

10. CRichEditCtrl won't show images or tables.

11. How to disable adding, inserting ord deleting Rows in the DataGrid (System.Windows.Forms.DataGrid)

12. UserControl does not show on running form and properies do not show

 

 
Powered by phpBB® Forum Software