Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: Datagrid Columns


Message #1 by "Warren Nielsen" <warren.nielsen@a...> on Tue, 30 Apr 2002 02:03:34
I was hoping someone might be able to show me a code example on how to 
hide a column in a datagrid which has the aut gen property set to true.

The problem is I have a Parent Datagrid which show 1 column and a child 
datagrid which is a crosstab query in.  I the Child Datagrid is aut gen'ed 
as the number of users varies.  I filter the Child table on the categoryID 
from the Parent and I need to hide this column in the Child Datagrid.

Any assistance would be greatly apreciated.

Warren
Message #2 by David.Martret@q... on Tue, 30 Apr 2002 11:11:06 +1000
I used to do it in the beta version by removing the column from the
DataView before the binding it:
     DV1.Table.Columns.RemoveAt(0)
     DataGrid1.DataSource = DV1
     DataGrid1.DataBind()
However, this solution doesn't work in the full release version if the
column you are removing is part of the primary key.

Dave.



                                                                                                                          
                    "Warren Nielsen"                                                                                      
                    <warren.nielsen@a...        To:     "ADO.NET" <ado_dotnet@p...>                               
                    ed.com.au>                  cc:                                                                       
                                                Subject:     [ado_dotnet] Datagrid Columns                                
                    30/04/02 12:03                                                                                        
                    Please respond to                                                                                     
                    "ADO.NET"                                                                                             
                                                                                                                          
                                                                                                                          



I was hoping someone might be able to show me a code example on how to
hide a column in a datagrid which has the aut gen property set to true.

The problem is I have a Parent Datagrid which show 1 column and a child
datagrid which is a crosstab query in.  I the Child Datagrid is aut gen'ed
as the number of users varies.  I filter the Child table on the categoryID
from the Parent and I need to hide this column in the Child Datagrid.

Any assistance would be greatly apreciated.

Warren





  Return to Index