B
Brett Romero
I have one DataTable used in a datagrid. I have multiple TableStyles
to defining various views of the data. The table contains 20 unique
columns. I have four TableStyles, each with containing five columns.
I'd like to switch out these four views on button clicks. One view
will display at a time. Rather than create four datatables, I feel the
tablestyles and switching them is quicker. Comments?
For some reason, it isn't working. I do this in form_load() where dgts
is a gridtablestyle object:
dgtsSummary.MappingName = "Summary";
dggrid.TableStyles.Add(dgtsSummary);
I'm doing this on a button click for testing:
ds.Tables[0].TableName = dgtsSummary.MappingName;
dggrid.Refresh();
Right now, the tablestyle has only one mapped column, which should make
the grid display only that column. However, I'm still seeing all
columns. Each column in the table does have a space. Is the correct
mapping name "[some column]" or just "some column"?
Finally, how do I switch grid views by changing the mappings upon
button clicks?
Thanks,
Brett
to defining various views of the data. The table contains 20 unique
columns. I have four TableStyles, each with containing five columns.
I'd like to switch out these four views on button clicks. One view
will display at a time. Rather than create four datatables, I feel the
tablestyles and switching them is quicker. Comments?
For some reason, it isn't working. I do this in form_load() where dgts
is a gridtablestyle object:
dgtsSummary.MappingName = "Summary";
dggrid.TableStyles.Add(dgtsSummary);
I'm doing this on a button click for testing:
ds.Tables[0].TableName = dgtsSummary.MappingName;
dggrid.Refresh();
Right now, the tablestyle has only one mapped column, which should make
the grid display only that column. However, I'm still seeing all
columns. Each column in the table does have a space. Is the correct
mapping name "[some column]" or just "some column"?
Finally, how do I switch grid views by changing the mappings upon
button clicks?
Thanks,
Brett