Hi,
I am developing a Media Solution Application as a Windows Program in Visual Studio 2008 and MsSql Server 2008. The problem is there are a lot medias. I have to organize that medias in unlimited groups like a nested relation. A media can repeat in many groups or repeat in playlist by itself with no group. Let me try to tell you in tables.
Medias
---------------------------------------
MediaID
Media
MediaType (Enum=> Group=1 , Media=2)
.
.
.
MediaGroupMedias
----------------------------------------
MGMID
MainGroupID
MediaID
.
.
.
Let's insert some data.
Medias
----------------------------------------
MediaID Media MediaType
1 Bamboleo 2
2 Spanish Guitar 2
3 Hips Don't Lie 2
4 How you remind me 2
5 Clips 1
6 Pop 1
7 Rock 1
MediaGroupMedias
---------------------------------------------------
MGMID MainGroupID MediaID
1 5 6
2 5 7
3 6 1
4 6 2
5 6 3
6 7 4
As you see we can make a huge playlist. It seems No problem in that db design but in practice but i couldn't show this structure on gridview in a hiearchy view. I want to show like a treeview but on the grid. I was unavaliable to show on grids. I tried on DataGridView & RadGridView (Q3 2007). So i have to find out a new solution for that. New solution looks like:
The tables are Media, Groups and GroupMedias.
Medias
---------------------------------------
MediaID
Media
.
.
.
Groups
----------------------------------------
GpID default (0) // 0: for nonegroup medias
MainGPID default (0): is main group
.
.
.
GroupMedias
-------------------------------------------
GpID
MediaID
.
.
.
And in the end i need a playlist table. That would be like below.
Playlist
---------------------------------------------
PID
MediaID Default (0) //if 0 then it's a group
GroupID Default (0) //if 0 then it's a media
So,
i have a few questions :)
-In that structure is it possible to make an hiearchy view on gridview?
if so how? (Should i create datatables in runtime?)
-Is there another better solution? ( i think there will be more than one)
if you can offer i will appricate you. :)
Thanks in advance.
Bests