Hiding a column in a datagrid bound to an entity

Posts   
 
    
kevinm
User
Posts: 2
Joined: 29-Dec-2003
# Posted on: 29-Dec-2003 18:07:56   

I can't seem to figure out how to do this. For example, in the VB Northwind example, can someone tell me how to only show the Contact Name column in the Customer Selector datagrid? Any help would be greatly appreciated.

Kevin

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 29-Dec-2003 18:51:42   

You have to add a TableStyle for that to the grid, using the grid's properties.

Set the MappingName of the TableStyle you add to 'CustomerCollection', and add a gridcolumnstyle to your tablestyle. Set the mapping name of that gridcolumnstyle to ContactName and set the caption text to Contact Name

Watch the casing, it has to be correct.

REcompile and run, you'll see 1 column now.

Frans Bouma | Lead developer LLBLGen Pro
kevinm
User
Posts: 2
Joined: 29-Dec-2003
# Posted on: 30-Dec-2003 18:16:22   

Thanks Otis. I guess I was messing up the Mapping Name. It works now.

Kevin

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 30-Dec-2003 18:21:25   

kevinm wrote:

Thanks Otis. I guess I was messing up the Mapping Name. It works now.

Kevin

Yes, that's a tricky part. After I read your question I had to fiddle with that name for some time, read some Faq's to get it right simple_smile

Frans Bouma | Lead developer LLBLGen Pro