:mad:
Please help. I want to Hide a column in my Datagrid after I have set the Grids datasource to a dataset.
Printable View
:mad:
Please help. I want to Hide a column in my Datagrid after I have set the Grids datasource to a dataset.
might be a better way out there but you could consider using a dataview as the source...
Thanx powdir. What I want to do is to create an inner join, Then on my main Form have Textboxes for the main table and a datagrid for the table joined with the main table. The datagrid's datasource is set to the datatset. So what happens is the datagrid is showing both tables and the text boxes are showing the main table. Thats why I need to hide some columns.
Ok...kinda with you, but if your datagrid is displaying fields that are already displayed via textboxes why not use a dataview as i suggested to filter out these duplicates fields and then set the datagrid's datasource as the dataview...Cheers
try this ...!
from MS VS Documentation
VB Code:
Dim ColumnIndex As Integer = 1 ' Remove the second column Dim myGridColumns As GridColumnStylesCollection myGridColumns = DataGrid1.TableStyles(0).GridColumnStyles myGridColumns.RemoveAt(ColumnIndex)