Create a listview in hierarchy and bounded using LINQ

Hi,
I would like to know how I can setup a listview (or any other asp control), so that it can be bounded to LINQ and will show the hierarchy of the data.
Here is my data:
Year      Name
2014     Apple
2014     Orange
2014     Manago
2013     Apple
2013     Grapes    
It will just start with the Year:
+ 2014
+ 2013
When the year is expanded, it will show the information under that year, so it will look like this when 2014 is clicked:
- 2014     
    Apple
    Orange
    Manago
+ 2013
Please advice, your help would be greatly appreciated!

Hi,
According to your description, you want to retrieve data from a SharePoint List using LINQ, then display the data upon a GridView control or other controls.
For about retrieving data with LINQ, here are two demos for your reference:
http://msdn.microsoft.com/en-us/library/office/hh135094(v=office.14).aspx
http://www.codeproject.com/Articles/399927/SharePoint-LINQ-and-SPMetal
For organizing the data retrieved in a list view like control, suppose you are developing a Visual Web Part, SPGridView control would be a good choice for you.
A solution with code provided would be helpful for a quick start in using SPGridView:
http://code.msdn.microsoft.com/office/Ejemplos-sobre-cmo-usar-el-69cd5f16
More information about SPGridView:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spgridview(v=office.14).aspx
http://www.codeproject.com/Articles/35536/Creation-of-a-SPGridview-Webpart-having-Pagination
Feel free to reply if there are still any questions.
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they
help and unmark them if they provide no help. If you have feedback for TechNet
Subscriber Support, contact [email protected]
Patrick Liang
TechNet Community Support

Similar Messages

  • Parent child hierarchy and measure using lookup

    Hi,
    I'm using OBIEE 11.1.1.5 and I have an issue with a parent child hierarchy, which is setup like case 4 in this example . When I create a simple analysis using the hierarchy and a simple measure, it works fine. But when I try to use a calculated measure using a lookup formula, I get the following error:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 46036] Internal Assertion: Condition pTableRef->GetLeftTable() && pTableRef->GetLeftTable()->IsTableReference(), file server/Query/Optimizer/ServiceInterfaceMgr/Src/SQOIDriveJoinGenerator.cpp, line 568. (HY000)
    Does anyone know how to get past this error?
    Thanks,
    Mihai

    Hi,
    I'm using OBIEE 11.1.1.5 and I have an issue with a parent child hierarchy, which is setup like case 4 in this example . When I create a simple analysis using the hierarchy and a simple measure, it works fine. But when I try to use a calculated measure using a lookup formula, I get the following error:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 46036] Internal Assertion: Condition pTableRef->GetLeftTable() && pTableRef->GetLeftTable()->IsTableReference(), file server/Query/Optimizer/ServiceInterfaceMgr/Src/SQOIDriveJoinGenerator.cpp, line 568. (HY000)
    Does anyone know how to get past this error?
    Thanks,
    Mihai

  • I have created a slideshow in iPhoto and then used iDVD to burn the sideshow to a DVD. The quality of the DVD is poor. Any ideas?

    I have created a slideshow in  iPhoto and then burnt it to DVD using iDVD. The quality of the slideshow on the DVD is poor. Any ideas?

    Poor in what way?  iDVD creates standard definition displays of 640 x 480 pixels and will not look as sharp as the orignal photos in the iPhoto slideshow on a Mac monitor. 
    OT

  • How to create Presentation variable for columns and to use it in Narrative?

    Hi All,
    Anybody know how to create presentation variable for a column (i.e., i need to create it in edit formula section itself). And then, I should use it in Narrative section to display that column value. Is it possible? Or do i need to use any other variable for this requirement? If so please let me know, how to create it? This is very urgent requirement.
    Thanks in Advance
    Thenmozhi

    Hi Satya,
    I just want to create a table that should horizontally display the values like below:
         SUID Tag # :123456               Year Mfg: 2007                                                                                     
         Description: computer corporation FA ID#: 4576
         Model Number: 4569 hESC: #ert
         Serial Number: 78945 Flags: c
    Department: Hematology
    User: thenmozhi
    Database: OLAP
    I think we can create this type of report using either Narrative or Static Text. But I am not sure whether it is possible or not? And also another thing is that sectioning is applied for SUID Tag # column. So, depending on the dashboard prompt if the SUID Tag # retrieves two or more values.
    Then the first value for example 123456     and the values for the other columns related to this SUID Tag # value should display in the first page (i.e., page 1). And if the next value of the SUID Tag # for example say 678901 then the values should move to second page that is like this:
         SUID Tag # :678901               Year Mfg: 2008                                                                                     
         Description: Computer Manufacturing FA ID#: 4577
         Model Number: 4570 hESC: #eth
         Serial Number: 78946 Flags: G
    Department: Hematology
    User: Rehman
    Database: OLAP
    Thanks
    Thenmozhi

  • Should we create the same IDOC type and message type?

    Hi all, if we want to send an IDOC from one R/3 system to another R/3 system type, should we have to create the IDOC type in one system, then repeate the steps in another system? If we don't have to, what shoud we do?

    assuming you want to create a custom IDOC type and not use a standard one, you can create it in one system and then transport it to the other system using normal transport procedure (STMS).
    Cheers
    Thomas

  • C#: Issue reducing ListView Flickering by using Begin/EndUpdate and or using AddRange

    I'm trying to reduce ListView flickering because I load over 250,000 items into a listview (5 columns x 50,000 ListViewItems), which takes about 5 minutes. I found two potential solutions but cannot get either of them to work.
    MSDN BeginUpdate/EndUpdate
    - Is one solution which is supposed to prevent redrawing until reaching the of the For/Loop cycle. However, I have these strategically placed as demonstrate by this source and it still does it.
    MSDN ListView.AddRange: Is the second option recommended in the previous link, and attempts to reduce flickering by adding a range of listview items as opposed
    to doing so individually.  The issue here is I'm not able to figure out how to convert my string array of values to an array for listview values (ListViewItems[]). This is also compounded by the fact that whatever I do, I have to prevent cross-threading
    by passing through a delegate and method. This is the solution I think I will need to implement but I need your help.
    This is the code ("Loading()")s wrapped in the BeginUpdate/EndUpdate, which doesn't appear to work, maybe because this method is within an async thread. This method is also where I want attempt converting my string to a ListViewItemCollection
    to see if the "AddRange" will help reduce or eliminate the flickering.
    The Additem() method below that is what I will have to tweak if I can, with some assistance, get the "AddRange" option working.
    private void Loading()
    int t = 1;
    listView1.BeginUpdate();
    foreach (string line in scripts)
    string[] listValues = line.Split(',');
    ListViewItem values = new ListViewItem(listValues);
    if (t == 1)
    AddColumn("Script Name", 200); // Creates column headings
    AddColumn("Date and Time", 150);
    AddColumn("SID", 75);
    AddColumn("Environment", 75);
    AddColumn("Client", 75);
    t++;
    else
    if ((values.Text != "") && (values.Text != "Script Name"))
    AddItem(values);
    if (!dictScript.Contains(values.Text))
    dictScript.Add(values.Text);
    AddScript(values.Text);
    listView1.EndUpdate();
    The AddItem() method to handle cross-treading issue:
    private void AddItem(object o)
    if (this.listView1.InvokeRequired)
    AddItemCallback d = new AddItemCallback(AddItem);
    this.Invoke(d, new object[] { (ListViewItem)o });
    else
    { // code that adds item to listView (in this case $o)
    listView1.Items.Add((ListViewItem)o);
    SV

    That was a great suggestion! It worked perfectly!
    I solved two problems with in one new learning moment. This took care of the flickering and loaded in less than 3 seconds with 60,000 entries.
    In response to Phil, I absolutely agree in any other case. However, this will meet the applicaiton requires and how the users intend to use it.
    Thanks fellas!
    This was my VirtualListViewTest code.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Net;
    using System.IO;
    namespace DirectorVirtual
    public partial class Form1 : Form
    private string info;
    private string infoDS1;
    private string infoDS2;
    List<ListViewItem> scripts;
    public Form1()
    InitializeComponent();
    scripts = new List<ListViewItem>();
    private void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
    e.Item = scripts[e.ItemIndex];
    private void Loading()
    listView1.View = View.Details;
    listView1.Columns.Add("Name", 200); // Creates column headings
    listView1.Columns.Add("Date and Time", 150);
    listView1.Columns.Add("Person", 75);
    listView1.Columns.Add("Computer", 75);
    listView1.Columns.Add("Location", 75);
    foreach (string s in info.Split('\n'))
    if (!s.Contains("Name"))
    scripts.Add(new ListViewItem(s.Split(',')));
    listView1.RetrieveVirtualItem += new RetrieveVirtualItemEventHandler(listView1_RetrieveVirtualItem);
    listView1.VirtualListSize = scripts.Count;
    listView1.VirtualMode = true;
    private void DownloadData()
    try
    // Retrieve the contents of the Execution Log.txt file
    WebClient web = new WebClient();
    // 2.0 Data
    infoDS2 = web.DownloadString("http://dummylink.net/Execution_Log.txt");
    // 1.0 Data
    infoDS1 = web.DownloadString("http://dummylink.net/Execution_Log_1.0.txt");
    web.Dispose();
    catch
    MessageBox.Show("Failed to retrieve the Execution Log.", "Execution Log Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
    System.Windows.Forms.Application.Exit();
    Environment.Exit(0);
    info = infoDS1 + infoDS2;
    private void button1_Click(object sender, EventArgs e)
    DownloadData();
    Loading();
    SV

  • Is there a way to create an object using Trapcode Form and then use that object as a particle in Trapcode Particular?

    I made some objects in Cinema 4D and I tried to import them into After Effects CC 2014.  I get an error saying 'Cannot find Adobe Premiere Pro Dynamic Link'.  So I tried it in AE CC and that worked.  However, I want to create a form object and then use that as a particle for Trapcode Particular.  Is this even possible?
    Thank you for any help!

    There are also size limitations or rather suggestions for particle size. If I were creating an animated 3D shape using Form or C4D and wanted to use it as a particle I would keep the size of the particle about 1/6 to 1/8 of the comp size. You would create a new comp for your particle, animate it, then nest the particle comp in your main comp, turn off visibility, and then use it as a particle in Particular.

  • Create a follow up page in scripts using Duplex and Tumble Duplex in print

    How to create a follow up page in scripts using Duplex and Tumble Duplex in print mode of scripts ?

    it depends upon output device types.
    Regards
    Prabhu

  • HT204053 I need to change my i cloud e-mail address to the same one I set up when I purchased my apple account I just created an I cloud address and when Ijust read the set up for I cloud it says  I should use the same e-mail address that I started with H

    I did not know that when I created a e-mail address that I was suppose to use the same one that I created when I first signed up with Apple I phone. I want to change my e-mail address to the one I first had How can I change it? I do not need two e-mail accounts It should have read that when you are setting up an e-mail address use the one that you first signed up with. Not after you go through all the set ups for I cloud it tells you at the end to use your account that you first started with. Can you please help me I am new at this and I still can not set up on my computer with my phone to I cloud so if I had my phone stollen I can find it I also have and I pad to set up yet It is 3 days and I still can not set it up
    Thank You and Hoplefully I can change my e-mail address so I can have everything on one account

    If you selected open a new Apple ID account, go back a step and enter use existing Apple ID.
    You will have to set up a separate iCloud account or your iPads will mirror each other.

  • I have 3 apple devices and I use the same apple ID for all 3.  I would like to create a new I'd for one of my devices, but do not want to loose the apps on that device.  Anyone know how I can do this?

    I have 3 apple devices and I use the same apple ID for all 3.  I would like to create a new I'd for one of my devices, but do not want to loose the apps on that device.  Anyone know how I can do this?

    Create a new ID:
    On the iPod go to
    - Settings>Messages>Send and receive and sign out your ID and sign into the other one. Make sure that only her ID email address is listed.
    - Settings>FaceTime sign out of your ID and sign into the other one. Make sure that under You can be reached at only the newID email address is listed
    - Settings>iCloud and sign out and sign in with the new one
    - Settings>iTunes and App Store and sign out your ID and sign in with the new one.
    - Apps are locked to the account that purchased them.
    - To update apps you have to sign into the account that purchased the apps. If you have apps that need updating purchased from more than one account you have to update them one at a time until the remaining apps were purchased from one account.

  • My iTunes is creating duplicates of playlists and hanging up. running latest version of lion, and iTunes using match and iCloud. please help. I have uninstalled and reinstalled iTunes.  deleted all library files and is doing same thing.

    I am runing lion and latest version of itunes.  I have match on, home sharing on and using icloud.  my itunes started hanging up and required me to force quit.  then upon restart of itunes and restart of computer itunes would take upwards of 15 minutes to open and was using >90% of CPU and would be lagging in response if responding at all one of the playlists I had created on my ipad had over a hundred copies of the same playlist.  after repeated restarts I uninstaled itunes and reinstalled.  this didnt rectify the problem.  I assumed library file had somehow become corrupt so I deleted library files, reimported all my music and synced with genius and match.  and let the computer go over night. when I woke in morning all my music was back but I had all the extra playlists again and itunes is hogging all the cpu and was minimally responsive and hanging up after each click. 
    I thought this might be a virus or something but installed ESET cypersecurity did a complet scan with no threats found.  I am at a total loss and do not know where to go from here.  I hope one of you can assist.  Thanks!

    I had this exact issue.  Spent over an hour on the phone with apple support, they couldn't resolve.  Here is what I ended up doing, that worked.
    1.  Turned iTunes match off on all my iOS devices
    2.  Deleted the offending playlists from the iOS device they originated on
    3.  Started iTunes, let it run (literally) for an hour before it became responsive.  First thing I did, before clicking anywere else was disable iTunes match.  If I clicked anywhere, it would clock for another hour.
    4.  Let iTunes run overnight, by morning it had cleaned out the repeating play lists.  This got my Mac/iTunes back to an operable state.
    5.  Restore iPhones from backup in iTunes.
    What was causing my issue was a single playlist that was created on an iPhone, then suddenly showed up with several thousand duplicates on my other iPhone.  The culprit playlist did not, for some reason, duplicate itself on my two iPads.  Apple support seemed to think it was because the problem iPhone tried to sync the playlist to iCloud over and over again unsuccessfully, then it finally went through and populated the thousands of blank/failed playlists which then tried to propigate to iTunes and my other iOS devices.  Seems like a reasonable theory.
    I have not yet re-enabled iTunes match.  So, no idea what will happen if I decide to go back down that rabbit hole.

  • I have created several short (3-5 minute) movies using iMovie 10.0.6 and Yosemite.  I want to create one movie that includes these short movies that I can then either burn to a DVD or show in iMovie's Theater.  How can I do it?

    I have created several short (3-5 minute) movies using iMovie 10.0.6 and Yosemite.  I want to combine those short movies into one movie that I can loop and burn on a DVD or show in iMovie Theater.  How can I do it?  The movies are now shared to iTunes.

    Another easy way to fix this.
    What I've noticed is that upon upgrading your projects and events to work with iMovie 10, initially it will work... Until you quit iMovie and reopen it again. Any events with hashtags will show up without the star next to the iMovie event. SO, if you happen to read this, after upgrading to iMovie 10 from its predecessor, immediately change the event name to NOT include a hashtag/pound symbol.
    Otherwise, if it's too late, you can either do the above or this...
    Hold down option and click on iMovie. This will prompt you Locate, Create a New Library, Cancel this window, or Choose a different library. What you want to do is create a new library, call it whatever you want to, this will only be temporary. After the program opens, it should be a blank Library. Then go to File > Open Library > iMovie Library (your original library) and proceed to change the name of your events. Quit the program. Go into your Movies folder in Finder, delete the library you temporarily created, and your back in business.

  • HT204053 i am trying to create an account for icloud. i have had itunes for years and am using my apple id. however it is coming back as saying this is your apple id but not your icloud id??? from what i have read this is the same thing. i cant get passed

    I am trying to create an icloud account and  have used itunes for years . Therefore have been using my apple id to sign in. Unfortunatly it keeps coming back saying this is my apple id but not my icloud id is this different?
    Ive looked at help and it states its the same i have changed my passord several times as i thought it was this. Can anyone please help.??

    I've tried both. First, I tried on my pc, where iTunes had installed iCloud when it last updated. I have iTunes installed on this computer (and on my iPad and iPhone), but that wasn't the issue.
    So I went online, thinking I needed a separate iCloud Apple ID, but it prompted me for my current Apple ID and gave me the message about my ID being "valid" but not an iCloud account," which, lol, was what it had asked me to do in order to create one. I checked, and at least one other user is having the same issue. I'll attempt to copy/paste the Support request url: https://discussions.apple.com/thread/4430653?tstart=0
    Thank you for any help you can give.
    Trish

  • I have created my site with Muse and have uploaded to an external ftp hosting, now my secure log in will not work because I am not using BC. Is there a way to create a secure log in that will work with out being forced to use BC?

    I have created my site with Muse and have uploaded to an external ftp hosting, now my secure log in will not work because I am not using BC. Is there a way to create a secure log in that will work with out being forced to use BC?

    Hi
    Secure Zone login feature will only work if you host your website with Business catalyst.
    Please take a look to this as an alternative
    Password Protect Pages Widget for Adobe Muse
    Also, check this thread,
    Re: Can I create a login/password protection in Muse for a HTML5 page or two?

  • Can I create a fillable pdf form and then export it for client use on my web site?

    Can I create a fillable pdf form and then export it for client use on my web site?  I need clients to be able to fill in the (registration) form on my site then submit it via email.

    [discussion moved to Creating, Editing & Exporting PDFs forum]

Maybe you are looking for

  • IPhone 5S voice echo

    I'm getting a echo of my voice when i'm talking.

  • ABAP Report with INCLUDE for subroutine.

    Dear All, I have ABAP report list. I have the following code: SELECT-OPTIONS: s_date FOR oijne-astdtt. PARAMETERS : p_time LIKE sy-uzeit DEFAULT sy-uzeit. SELECT-OPTIONS : s_soldto FOR oijnomi-soldto. in my program i have INCLUDE ZER0100F. as incude

  • How to install photoshop using scripts?

    Is there a way to install photoshop using scripts? Batch/vbscript will do. Appreciate your feedback.

  • Opening Mac FLAs on a PC - how?

    I'm trying to open an FLA that I'm pretty sure was created on a Mac. I'm trying to open it on a PC in MX. I get an 'Unexpected File Format' error when trying to open. Any suggestions? Are there any programs like Flash Typer that open Mac files on a P

  • Blacks are becoming rich blacks when exporting to PDF in CS2

    Im having a funny problem I have never noticed before where when I export to PDF from InDesign CS2 all blacks turn to rich blacks. I am verifying this by opening it up in Acrobat and viewing the separations. I have narrowed it down to a single settin