Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Datagrid and Dataview - hiding columns

Status
Not open for further replies.

geedubcpa

Programmer
Oct 5, 2005
19
0
0
US
I am unable to figure out how to hide columns when i use a datagrid and dataview together.

Any ideas on this?
 
I am answering my own question on this.

When you have a dataview as the datasource for a datagrid, you have to go to the code for the datagrid.tablestyles and write your code in there. It will not allow you to do it visually via the wizard, but it works fine at the coding level.

The mapping name is the table name of the dataset that feeds the dataview.

Me.EasyTableStyle1.DataGrid = Me.EasyDataGrid2
Me.EasyTableStyle1.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() Me.FormattedTextBoxColumn1, Me.FormattedTextBoxColumn2, Me.FormattedTextBoxColumn3})
Me.EasyTableStyle1.HeaderForeColor = stemColors.ControlText
Me.EasyTableStyle1.MappingName = "Transactions"


This is the one i changed
PRIOR Me.datagrid.MappingName = ""
AFTER Me.EasyTableStyle1.MappingName = "Transactions"
 
This is the one i changed
PRIOR Me.datagrid.MappingName = ""
AFTER Me.EasyTableStyle1.MappingName = "Transactions"
Sorry if I've mis-understood, but how does that code above hide a DataGrid column?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top