Last post Nov 04, 2009 11:29 AM by DaveRuss
Oct 30, 2009 04:28 AM|isvaljek|LINK
How to merge two tables in one gridview on List.aspx? I don't know where to specify the join.
I would also like to only display only products table on home page, not the products and all product description child tables.
Currently home page looks like:
I would like the homepage to have:
And then when the products are selected to display a page where you can choose a category and then display the product + product description combo gridview(the join).
Oct 30, 2009 06:57 AM|punnanthomas|LINK
First merge one table to another and then bind the table to GridView
Oct 30, 2009 07:37 AM|isvaljek|LINK
Could you elaborate a bit more, I don't know where does the binding even happen in linq to sql dynamic data?
Oct 30, 2009 07:53 AM|RamchanderP|LINK
Use Joins in your SQL Query and then bind the GridView to your Sql Datasource
Oct 30, 2009 08:04 AM|isvaljek|LINK
Are we talking about Dynamic Data Web Site?
I'm using LINQ to SQL classes to drag-and-droppingly create abstraction of my tables, therein lies the problem, it's automatic and I don't know where in that process lies the sql string?
Nov 04, 2009 08:55 AM|DaveRuss|LINK
DynamicData builds pages in accordance with your datamodel - in Linq-to-sql's case the DBML file. If you want to merge two tables into a single page, you need to merge them when you create the DBML file.
If you want to hide certain tables from being Scaffolded you'll need to change global.asax to not scaffold all tables (ScaffoldAllTables = false) and then you can use the "Scaffold(false)" attribute to appy in your metadata for each table you don't want.
Nov 04, 2009 11:04 AM|isvaljek|LINK
Thanks, but could you be a bit more specific about creating the join in DBML file(I'm a total LINQ newbie)?
Nov 04, 2009 11:29 AM|DaveRuss|LINK
Sorry, I haven't used Linq-to-sql. I'm an Entity-Framework guy
You could try the Linq-to-Sql forum, or see if Steve can help - he's experienced in L2S.