This is a migrated thread and some comments may be shown as answers.

GridView ItemSource Sublist?

2 Answers 92 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
SchaF
Top achievements
Rank 1
SchaF asked on 01 Nov 2012, 08:44 PM
Im not exactly well versed with Telerik or even silverlight but I do have a question about something. Lets say I have a grid view for uploading images for an account. So I log in, upload the images and they are stored in an object with the Account name they were uploaded for, then the ItemSource is binded to this object and the Account they were uploaded for is displayed.

So lets say my name is John and I manage 3 accounts, Bears, Tigers, and Wolves, and Im uploading images for all three of them. I log in, select Bears and upload 3 images. They are sent to the database with their file information and stored in the database (like file name, type, uploading user, time and date etc, account its for etc), and the object has the list of images uploaded along with the account name Bears; then the gridView.ItemSource = is set to the object  and it populates one row in the gridView and it just says "Bears". Then I repeat the process but this time for Wolves, and when the gridView is binded the second time, there are 2 records in the gridView. "Bears" and "Wolves". Next to each object is a little + sign, would it be possible so when the user clicks the + sign, to display the images uploaded for the account?

Im not exactly sure how templates work with silverlight or telerik controls but is this possible so if i uploaded files for Bears called, bears1.jpg, bears2.jpg and bears3.jpg, and i click on the + sign by the "Bears" item in the gridview, it drops down and shows the 3 file names?

2 Answers, 1 is accepted

Sort by
0
SchaF
Top achievements
Rank 1
answered on 02 Nov 2012, 05:02 PM
I think I basically just need a way to create a row in a gridview, but for that row to have subrows to show the files uploaded, I just have no idea how this is done. It sounds like something along the lines of hierarchies but I have no clue how to do that and havent found any code that I can follow to see how to create sub rows. Any help would be much appreciated.
0
SchaF
Top achievements
Rank 1
answered on 02 Nov 2012, 07:57 PM
I think basically what I want to do is create a simple GridView so when the images are uploaded, in the background I have an object called "Upload" with the account it was uploaded for "Bears/Wolves....etc", who uploaded it, and a list (ObservableCollection) or the image objects (which has the file name, image type, size, upload date etc). So when I am done uploaded, then I set the gridview.ItemSource = uploadObject, and I want the sub row/hierarchical/child gridView rows to be generated off of the uploadObject.Images list. How can I do that?
Tags
GridView
Asked by
SchaF
Top achievements
Rank 1
Answers by
SchaF
Top achievements
Rank 1
Share this question
or