Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGrid: How to hide the right side / present data as a simple table
 

DataGrid: How to hide the right side / present data as a simple table

A simple question: Is it possible to hide the left column with the little triangle in the datagrid?

(e.g.; se the picture here http://4.bp.blogspot.com/_zzTSOjT_dhM/SKQWYpS74uI/AAAAAAAAAfE/hi90YjBdy7E/s1600-h/Shalvin+Wpf+WindowsForms+DataGrid+Interop.JPG)

Purpose: I need to generate a simple presentation af data as a table without the datagrid-features; thus I have coloured the other bgcolors white and hidden the gridlines but the right side is still gray and I cannot hide it. The tableadapter uses a simply query the displays a top five ordered by scores in a database table.

What I wnat to present is something like this in simple html:

header1 header2 header3
data data data
data data data
data data data
data data data
data data data

Jakob Flygare  Thursday, November 20, 2008 5:33 PM

Hi Jakob,

Try with following grid property.

Code Snippet

dgv.RowHeadersVisible = False

If still problem , let me know.

Thank You

Best Regards

Utkarsh Gajjar

Utkarsh  Thursday, November 20, 2008 6:29 PM

Hi Jacob

For DataGrid, please set CaptionVisible and RowHeaderVisible to false, and it will display like what you want:

Code Snippet

public Form8()

{

InitializeComponent();

this.dataGrid1.CaptionVisible = false;

this.dataGrid1.RowHeadersVisible = false;

}

Please feel free to let me know how it works.

Thanks.

Best wishes

Jun Wang

Jun Wang Tim  Monday, November 24, 2008 7:56 AM

Hi Jakob,

Try with following grid property.

Code Snippet

dgv.RowHeadersVisible = False

If still problem , let me know.

Thank You

Best Regards

Utkarsh Gajjar

Utkarsh  Thursday, November 20, 2008 6:29 PM

Hi Jacob

For DataGrid, please set CaptionVisible and RowHeaderVisible to false, and it will display like what you want:

Code Snippet

public Form8()

{

InitializeComponent();

this.dataGrid1.CaptionVisible = false;

this.dataGrid1.RowHeadersVisible = false;

}

Please feel free to let me know how it works.

Thanks.

Best wishes

Jun Wang

Jun Wang Tim  Monday, November 24, 2008 7:56 AM

You can use google to search for other answers

Custom Search

More Threads

• Transforming data values?
• Problem in datagridview regarding multi-selection and adding new rows
• pros and cons of databinding
• merge cells in datagridview
• using error message
• Datagridview Mouse Wheel & Vertical Scrollbar problem
• RowFilter property of the RelatedDataView
• Haw to update
• Changing the built-in ErrorProvider icon for a DataGridView
• ADD A LIST OF TABLES FROM SQL Database