I just finished playing around with the datagrid table styles. My datagrid
has 22 fields. That was way less fun than doing the dv1...columnmapping
thing. Mostly because I couldn't get the tablestyle to work. I set the
desired column width to 0 for the column I want to hide, but it did not get
hidden. So I played around with dgr1.TableStyles(0) in the code and got
error messages. How do I hide my column with the tablestyles?
"Ken Tucker [MVP]" wrote:
Hi,
I would add a tablestyle to my datagrid. You can specify which
columns are shown and their format.
http://msdn.microsoft.com/library/de...asicprimer.asp
http://msdn.microsoft.com/library/de...stdatagrid.asp
Ken
---------------
"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:36**********************************@microsof t.com...
I figured it out:
dv1.Table.Columns(0).ColumnMapping = MappingType.Hidden
"Rich" wrote:
I have a datagrid that uses a dataview object for its datasource. The
dataview contains a unique row identifier column. I don't want to display
this column in the datagrid. I need the unique row Identifier column so
that
I can run updates on the SqlAdapter object. Is there a way to hide this
column from the datagrid?
Dim dv1 As New DataView(ds.Tables("tbl1"))
dv1.AllowNew = False
dgr1.DataSource = dv1 '--dgr1 is the datagrid
I checked the dropdown lists for dv1 and dgr1 but did recognize anything
for
hiding a column.
Thanks,
Rich