Display information for each user in a separate box/container

Last post 05-09-2008 6:39 PM by moises.dl. 5 replies.

Sort Posts:

  • Display information for each user in a separate box/container

    05-09-2008, 4:51 PM
    • Loading...
    • Lotos1
    • Joined on 04-10-2008, 9:11 PM
    • Posts 37

    I have some user information in a database, now I want to be able when someone searches for a user that sells a particular item, to display all users that sell such item. I want to display information for each user in a separate box/container, and also have pages so that I display let's say 10 users per page. What control can I use to achieve this? I've seen it done on many sites, just don't know how to do it. DetailsView will not work since in displays information for a single user at a time. GridView also displays all records one below another, and each category is labeled in a column, and I would like to have titles for different categories displayed in a row, similar to DetailsView. Can someone explain how this can be done and show me some example. Thank you in advance. 

  • Re: Display information for each user in a separate box/container

    05-09-2008, 5:18 PM
    • Loading...
    • moises.dl
    • Joined on 09-12-2006, 11:17 AM
    • SLC
    • Posts 422

    youre going to have to create whatever controls you want at runtime and encapsulate such controls in a panel to keep them seperated, or you can just build a table at runtime if you have some HOT html skills hahaha...

     this is just an example that we used its alot more complex wthen probably what ur doing but heres a start maybe

    DataSet ds = dalOffers.GetAllAvailableOffers(nStoreId, nSegmentId, nPanelId, nMakeId);if (ds.Tables[0].Rows.Count > 0)

    {

    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)

    {

    string HtmlLine = "<hr />";

    DataRow row = ds.Tables[0].Rows[i];

    string tempHtml = row["strOfferHeader"].ToString() + row["strOfferDetail"].ToString() + HtmlLine;          ==here is where i get info about my "users"

    Panel pTemp = new Panel();

    pTemp.ID = "pnlOffer" + OfferId.ToString();

    pTemp.Attributes.Add("runat", "Server");   -- this is the indevidual panels

     

    RadioButton t = new RadioButton();

    t.ID = "RB" + OfferId.ToString();

    t.Attributes.Add("runat", "server");

    t.GroupName = "Group";

    t.Text = row["strOfferHeader"].ToString();           --this is just an example of how you have to give the controls unique id's with the info youre getting from you db

    pnlOffers.Controls.Add(pTemp);

     

     

    hope this helps man, just so you know once you start using dynamic controls you have to realize you are going to be handling all the state management! hollla

    +
    I just want to let her know that im money and im here to party...
    +
    Entry Mid Lvl DRAGON MASTER SOFTWARE ENGINEER
  • Re: Display information for each user in a separate box/container

    05-09-2008, 6:03 PM
    • Loading...
    • Lotos1
    • Joined on 04-10-2008, 9:11 PM
    • Posts 37

    But how can I add page numbers since I want 10 records per page? Also, the column names should be placed in a separate row for each record. I am using C#. This is what I am looking for:

    ___________________________________
    Name: xxxxxx                                      

    Location: xxxxx                                     

    Phone: xxxxxx

    Email: xxxxxx
    ___________________________________

    ___________________________________
    Name: xxxxxx                                      

    Location: xxxxx                                     

    Phone: xxxxxx

    Email: xxxxxx
    ___________________________________

    ___________________________________
    Name: xxxxxx                                      

    Location: xxxxx                                     

    Phone: xxxxxx

    Email: xxxxxx
    ___________________________________

     1 2 3 4 ...

  • Re: Display information for each user in a separate box/container

    05-09-2008, 6:12 PM
    • Loading...
    • moises.dl
    • Joined on 09-12-2006, 11:17 AM
    • SLC
    • Posts 422

    hahahahahahahaha dude ur nuts! youre going to have to build your own custom control

    +
    I just want to let her know that im money and im here to party...
    +
    Entry Mid Lvl DRAGON MASTER SOFTWARE ENGINEER
  • Re: Display information for each user in a separate box/container

    05-09-2008, 6:22 PM
    • Loading...
    • Lotos1
    • Joined on 04-10-2008, 9:11 PM
    • Posts 37

    Custom control? Many sites do it this way. Big Smile They all use custom controls for this? Do you have an example for me to take a look at?

  • Re: Display information for each user in a separate box/container

    05-09-2008, 6:39 PM
    Answer
    • Loading...
    • moises.dl
    • Joined on 09-12-2006, 11:17 AM
    • SLC
    • Posts 422

    ummmmm i dont have an example because its a large drawn out process its not just a throw together kind of thing. in your visual studio go to add new item and pick web user control

    it will look like a web  page and you design it like a web page if you want but think of it like this... when youer finished with your user control youre going to drag it on to your page like a control that comes with visual studio, its pretty complex in my opinion.

     

    wait it just came to me..... MAYBE JUST MAYBE i think you can add a gridview, then make your field templatefields and then THERE you can add any control you want to the gridview column, so in esence you can use a gridview to handle paging and such and have them in a nice little grid, but it wont look like a grid necessarily if you put a panel and label and all that stuff in the first column so it will be a once column table but it will look like a bunch of controls, does that make sense?

     this may help

    http://www.asp.net/learn/data-access/tutorial-12-cs.aspx

    +
    I just want to let her know that im money and im here to party...
    +
    Entry Mid Lvl DRAGON MASTER SOFTWARE ENGINEER
Page 1 of 1 (6 items)