Embedded DataGrids
-
Okay, this one's bugging me. I'm 99% sure I managed to figure it out a few weeks ago when I had some time on my hands. Now that I'm in a rush I just can't see it or find the example I did before. I have two related tables in a dataset (Player and Game). Each player can have any number of games. I want to show a datagrid with a player (with numerous details) in each row and then embed a datagrid in that row which shows all the games he's played in. I could do all that if I could only figure out what to use as the "DataSource" for the embedded (Game) datagrid. Any ideas? Does it complicate matters that the DataSource for the outer (Player) datagrid is a DataView, rather than the DataTable? Paul And you run and you run to catch up with the sun, but it's sinking
Racing around to come up behind you again
The sun is the same in a relative way, but you're older
Shorter of breath, one day closer to death - Pink Floyd, Time -
Okay, this one's bugging me. I'm 99% sure I managed to figure it out a few weeks ago when I had some time on my hands. Now that I'm in a rush I just can't see it or find the example I did before. I have two related tables in a dataset (Player and Game). Each player can have any number of games. I want to show a datagrid with a player (with numerous details) in each row and then embed a datagrid in that row which shows all the games he's played in. I could do all that if I could only figure out what to use as the "DataSource" for the embedded (Game) datagrid. Any ideas? Does it complicate matters that the DataSource for the outer (Player) datagrid is a DataView, rather than the DataTable? Paul And you run and you run to catch up with the sun, but it's sinking
Racing around to come up behind you again
The sun is the same in a relative way, but you're older
Shorter of breath, one day closer to death - Pink Floyd, TimeHow about the datagrid in a datalist? MyDUMeter: a .NET DUMeter clone
"Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of." -
How about the datagrid in a datalist? MyDUMeter: a .NET DUMeter clone
"Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."Why should it make a difference? A DataList binds in the same way as a DataGrid, doesn't it? And thus the inner DataSource should be the same either way. But I really do need it to be a DataGrid, we're talking about 500+ rows with a lot of data in each; it'll be about 500K to download if I can't use paging :-D Paul And you run and you run to catch up with the sun, but it's sinking
Racing around to come up behind you again
The sun is the same in a relative way, but you're older
Shorter of breath, one day closer to death - Pink Floyd, Time -
How about the datagrid in a datalist? MyDUMeter: a .NET DUMeter clone
"Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."Come to think of it, a DataRepeater (or even a DataList) within the DataGrid might be an option... maybe even preferable... but the question still remains the same. Paul And you run and you run to catch up with the sun, but it's sinking
Racing around to come up behind you again
The sun is the same in a relative way, but you're older
Shorter of breath, one day closer to death - Pink Floyd, Time -
Come to think of it, a DataRepeater (or even a DataList) within the DataGrid might be an option... maybe even preferable... but the question still remains the same. Paul And you run and you run to catch up with the sun, but it's sinking
Racing around to come up behind you again
The sun is the same in a relative way, but you're older
Shorter of breath, one day closer to death - Pink Floyd, TimePerhaps a custom server control? What about a datagrid in a templated column? MyDUMeter: a .NET DUMeter clone
"Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of." -
Perhaps a custom server control? What about a datagrid in a templated column? MyDUMeter: a .NET DUMeter clone
"Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."leppie wrote: Perhaps a custom server control? Shouldn't be any need for that. leppie wrote: What about a datagrid in a templated column? That's what I'm trying to do. :-D In the outer DataGrid, I have a single TemplateColumn, containing a table for the player details. Underneath that table (in the same DataGrid cell), I want another DataGrid or table-building DataRepeater to show the game details. So I'm trying to build a DataGrid at this point, but I need to know what to put in the DataSource property to say "I want all the games linked to the player (which at that point is know as Container.DataItem)" Paul And you run and you run to catch up with the sun, but it's sinking
Racing around to come up behind you again
The sun is the same in a relative way, but you're older
Shorter of breath, one day closer to death - Pink Floyd, Time -
Perhaps a custom server control? What about a datagrid in a templated column? MyDUMeter: a .NET DUMeter clone
"Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."I've found a temporary solution:
DataSource=<%# new System.Data.DataView(dsIndView.Game, DataBinder.Eval(Container.DataItem, "PlayerID", "PlayerID = '{0}'"), "Round", System.Data.DataViewRowState.CurrentRows) %>
It's a bit tacky and I can't put quotes around it (because it includes both kinds of quote), so I can't view it in design mode. But it works and that's good enough for now. If anyone has a better solution, please holler! Paul And you run and you run to catch up with the sun, but it's sinking
Racing around to come up behind you again
The sun is the same in a relative way, but you're older
Shorter of breath, one day closer to death - Pink Floyd, Time