Results 1 to 5 of 5

Thread: Not sure if I should use Gridview or not

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    513

    Not sure if I should use Gridview or not

    Hello: I'm creating a web app and have a new form.
    On this form, needs to be one row and 6 columns.
    The columns will need to contain dropdowns and textboxes.

    The user will be able to enter this form...either in edit or insert mode.
    If they are in insert mode, they will need to select an item from each dropdown and also enter text into the textboxes.

    As the user is tabbing to select/enter data into each of these objects, when they get to the 2nd to the last object, I will need to provide them with a new row
    that contains the same 6 columns and same ojects...esentially, add a new row.

    I was thinking it would be good to use a Gridview to do this but I'm new to web design (been doing window's apps till now)...and so not sure
    if the grid view will do all the stuff I spoke of above or if I need to create a user control or just add code that dynamically creates these objects when needed?

    what do you think is best for this paticular situation?

    thank you for your help.

    Proctor

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,606

    Re: Not sure if I should use Gridview or not

    I am not sure i a gridview could pop a second row without posting back and not sure the behavior it will get using an update panel. I never was on a situation of yours and it's an interesting question.
    Probably could be done with a Jquery grid but i won't put my hand in the fire, since i am currently reading Jquery and haven't had the opportunity to use p.e. slickgrid.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Not sure if I should use Gridview or not

    The GridView is very powerful, and very customizable, and I think that "out of the box" it will do almost everything that you want.

    However, based on this:

    As the user is tabbing to select/enter data into each of these objects, when they get to the 2nd to the last object, I will need to provide them with a new row
    that contains the same 6 columns and same ojects...esentially, add a new row.
    You will not get this for "free". You will have to do some manual work in order to get this to work the way you want this to.

    "Out of the box" you would typically use something like the FormView to allow the user to enter the information for a new row in the GridView, and then once submitted, show the populated GridView with the new row, with the ability for the user to edit the row once it has been created.

    Gary

  4. #4
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: Not sure if I should use Gridview or not

    The 2 design options are 1 use javascript to fire the event when the user reaches the 2nd last column input/object and to display another row of controls be it by creating it, making it visable or making an ajax call which seems overkill at first glance. This option is more user friendly because there is no page reload in the middle of entering data, it's all client side - in the browser... there is however browser compatability issues to consider if a wide range of users are expected.

    2nd when the user reaches the 2nd last column input/object - use the autopostback property of that control to do a round trip to the server and refresh the page with the added row... if that makes sence.

    In the first case I'd not use the gridview because I'd want control of html markup, element id's etc to make it easy for me to work with javascript. You may find a 3rd party grid control or .net grid with updatepanel does the trick but I'd don't have experience with these.

    The 2nd case is a sure fire method to keep all your logic/code server side and deliver a page that should not have compatability issues for users BUT it's not as user friendy and I would make the user enter 1 row/form at a time and click enter button not fire off a postback before finishing that entry.

    Your design choice really depends on who will be using the form.
    The problem with computers is their nature is pure logic. Just once I'd like my computer to do something deluded.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    513

    Re: Not sure if I should use Gridview or not

    Thank you all for your replies on this...it gives me a lot to think about. I think I'll spend a few days playing with these options, but tending to think I may go with the gridview and also the formview for adding new control -
    I think I would also have them click a button as suggested to add a new row.

    I did find quite a few links online that show a few creative ways to allow the user to use the gridview to add a new record so also want to look at that.

    Thanks again for your inputs......it really helps - especially since I'm the only programmer at my work so don't have anyone else to discuss ideas with.

    Proctor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width