Using datagridTableStyles on grids that are populated to a dataset with multiple relationshi

Greetings,

I have a data grid that is populated by a data set. This particular data set contains three tables (one parent and two children) that have relations set up. I'm trying to remove a column from each table when it is displayed on the grid. Removing the column for the parent table wasn't a problem. It is trying to remove the columns for the child tables that is making me scratch my head.

I was thinking it was a simple matter of using similar code for each child table. However, this does not work. I'm not sure the tablestyles collection contains the child table names. (Not sure how to check this) Also, I'm assuming I have to create new datagridstyles for each of the new table styles. However, in debug mode these child datagridstyles show as Nothing in the locals window (The parent shows it is a datagridstyle in the Locals Window).

It can't be that difficult to create table styles for the child tables. I feel I'm missing something simple, but there isn't much written on this subject in MSDN or other websites. It is mostly articles on how to deal with one table on the grid and add controls to the grid. Any assistance would be appreciated.

Thanks

[1218 byte] By [Lou_Davis] at [2007-12-23]
# 1
Could you not remove the columns directly out of the DataSet and each DataTable ? Then you would not have to worry about the styles. Might a quick solution.

James

JamesKnowles at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2

The problem is I'd like to do that but the column is the relation column (key Value) that relates the parent with the children. It is internal data that should not be seen by the user. The documentation I found said it should be possible to do as long as I use the same name of the table. After that I can't find any specific examples on how this might be accomplished. That's why I assumed the coding I did for the parent would work for the children, but it didn't.

Also, say I didn't want to remove a column but change a column attribute (example highlight a cell if the data falls into a particular range of values) or add a checkbox to a child table? I'd still be in the same pickle as there are no examples of how to work with the child tables in a grid. So if I learn the technique for removing a column in a child table, I can modify it a bit to use it for other types of grid formatting in the future.

Lou_Davis at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3

Lou,

I have not forgotten your problem I am just still looking for the answer.. anybody else out there can help jump in. ;-)

JamesKnowles at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...