datagrid

Discussion in 'MCAD' started by chris, Feb 2, 2004.

  1. chris

    chris Guest

    Hello Group,
    I came across this question and would like to know the
    solution for the same:

    Q>You are creating an ASP.NET page for your company. You create a DataGrid
    control that displays past purchases made by the user. The DataGrid control
    is populated from an existing database when the page is created.

    The page contains TextBox controls that allow users to update their personal
    information, such as address and telephone number. You need to ensure that
    the page is refreshed as quickly as possible when users update their contact
    information.

    What should you do?

    A. Set the Enabled property of the DataGrid control to false.
    B. Set the EnableViewState property of the DataGrid control to false.
    C. Write code in the Page.Load event handler that populates the DataGrid
    control only when the IsPostBack property of the page is false.
    D. Write code in the Page.Load event handler that populates the DataGrid
    control only when the lsPostBack property of the page is true.

    Thanks,
    Chris.
     
    chris, Feb 2, 2004
    #1
    1. Advertising

  2. chris

    ratpik Guest

    Setting the enabled to false will wipe the control right
    off the form, the view state has very little to do with
    refresh speed in most circumstances, although u can get a
    bit more speed with no view state. The IsPostBacks are
    the ones to look at, u only really want to fill the grid
    from your datasource on the first load if your view state
    is on. if u turn the view state off then u have to
    populate it every time. i would suggest leaving view
    state on and fill if(!IsPostBack)


    >-----Original Message-----
    >Hello Group,
    > I came across this question and would

    like to know the
    >solution for the same:
    >
    >Q>You are creating an ASP.NET page for your company. You

    create a DataGrid
    >control that displays past purchases made by the user.

    The DataGrid control
    >is populated from an existing database when the page is

    created.
    >
    >The page contains TextBox controls that allow users to

    update their personal
    >information, such as address and telephone number. You

    need to ensure that
    >the page is refreshed as quickly as possible when users

    update their contact
    >information.
    >
    >What should you do?
    >
    >A. Set the Enabled property of the DataGrid control to

    false.
    >B. Set the EnableViewState property of the DataGrid

    control to false.
    >C. Write code in the Page.Load event handler that

    populates the DataGrid
    >control only when the IsPostBack property of the page is

    false.
    >D. Write code in the Page.Load event handler that

    populates the DataGrid
    >control only when the lsPostBack property of the page is

    true.
    >
    >Thanks,
    >Chris.
    >
    >
    >.
    >
     
    ratpik, Feb 2, 2004
    #2
    1. Advertising

  3. chris

    Sharmila Guest

    Hi,
    I think the answer is D.
    To explain as simple as possible,
    As we need to ensure that data as updated ASAP u need to
    refrese the datagrid data as soon as the database is
    updated..which is done when the page is posted back when
    user edits textbook controls.So write code in Postback(i.e
    Ispostback property is true) to update the datagrid with
    new data.
    Oops has this remained simple.....

    I hope I am right here!!

    >-----Original Message-----
    >Hello Group,
    > I came across this question and would like

    to know the
    >solution for the same:
    >
    >Q>You are creating an ASP.NET page for your company. You

    create a DataGrid
    >control that displays past purchases made by the user.

    The DataGrid control
    >is populated from an existing database when the page is

    created.
    >
    >The page contains TextBox controls that allow users to

    update their personal
    >information, such as address and telephone number. You

    need to ensure that
    >the page is refreshed as quickly as possible when users

    update their contact
    >information.
    >
    >What should you do?
    >
    >A. Set the Enabled property of the DataGrid control to

    false.
    >B. Set the EnableViewState property of the DataGrid

    control to false.
    >C. Write code in the Page.Load event handler that

    populates the DataGrid
    >control only when the IsPostBack property of the page is

    false.
    >D. Write code in the Page.Load event handler that

    populates the DataGrid
    >control only when the lsPostBack property of the page is

    true.
    >
    >Thanks,
    >Chris.
    >
    >
    >.
    >
     
    Sharmila, Feb 3, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kawabzi

    About Datagrid Columns

    Kawabzi, Sep 22, 2003, in forum: MCSD
    Replies:
    2
    Views:
    446
  2. Daniel Joskovski

    Re: Problems facing in datagrid pagecount

    Daniel Joskovski, Apr 7, 2004, in forum: MCSD
    Replies:
    0
    Views:
    469
    Daniel Joskovski
    Apr 7, 2004
  3. Daniel Joskovski

    Re: Problems facing in datagrid pagecount

    Daniel Joskovski, Apr 8, 2004, in forum: MCSD
    Replies:
    0
    Views:
    502
    Daniel Joskovski
    Apr 8, 2004
  4. adolf
    Replies:
    4
    Views:
    480
    The Poster Formerly Known as Kline Sphere
    Jun 7, 2004
  5. Ranjandada

    Multiple forms on datagrid

    Ranjandada, Jul 28, 2006, in forum: Software
    Replies:
    0
    Views:
    781
    Ranjandada
    Jul 28, 2006
Loading...

Share This Page