DataGrid Won't come back

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default DataGrid Won't come back

    (please ignore my earlier post - it apparently had nothing to do with it
    being in an ascx control)

    I have, dozens of times, displayed datagrids, datasourced by an .xsd
    dataset, with textboxes in template columns and always been able to spin
    through those grids on, say a button click event.

    In a new project I am dynamicaly populating the datagrid columns, after
    which I retrieve data and do the following...

    da.fill(DataSet1) 'this is an untyped dataset
    dg.datasource = DataSet1
    dg.Databind()

    At this point my datagrid displays exactly like I want it to.

    BUT, on the button click event (which occurs after the user might changes
    some fields) my datagrid is empty!!!!

    This brings up a question: How was it that I am able to get the grid back in
    my other dozen programs where the grid is datasourced by a .xsd dataset?
    Why doesn't the grid contents (as changed by the user) exist in the click
    event?
    Thanks,
    T


    Tina Guest

  2. Similar Questions and Discussions

    1. Datagrid paging keeps going back to the first group
      Sorry to post this in 2 groups, but I just found this group after posting to the other group. I am using the datagrid. I have allowpaging=true. ...
    2. UserControl inside of datagrid - loses its viewstate when datagrid is re-bound on postback
      I have a simple usercontrol, a datepicker which contains 3 dropdownlist , it resides inside a datagrid column and i set the selecteddate property of...
    3. How to restrict the user to go back ones the user haslogged out. Or, if he goes back, how to generate custom errorfor
      :music; How to restrict the user to go back ones the user has logged out. Or, if he goes back, how to generate custom error for Page Expire ? :music;
    4. To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible?
      Hello, I am searching the whole Internet for a good example how to edit/update a DataGrid in a DataGrid (nested DataGrid). I know how to...
    5. "Back end not found. Or back end is busy"
      Hello, I get this message when I try to connect to my IDS 9.4 via the bde16. I use the client version 4 (sqld_inf.dll). The version 5 gave me...
  3. #2

    Default Re: DataGrid Won't come back

    Did you remember to re-bind the grid in the postback event?


    "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    news:uBK$m7TxFHA.3864@TK2MSFTNGP12.phx.gbl...
    > (please ignore my earlier post - it apparently had nothing to do with it
    > being in an ascx control)
    >
    > I have, dozens of times, displayed datagrids, datasourced by an .xsd
    > dataset, with textboxes in template columns and always been able to spin
    > through those grids on, say a button click event.
    >
    > In a new project I am dynamicaly populating the datagrid columns, after
    > which I retrieve data and do the following...
    >
    > da.fill(DataSet1) 'this is an untyped dataset
    > dg.datasource = DataSet1
    > dg.Databind()
    >
    > At this point my datagrid displays exactly like I want it to.
    >
    > BUT, on the button click event (which occurs after the user might changes
    > some fields) my datagrid is empty!!!!
    >
    > This brings up a question: How was it that I am able to get the grid back
    > in my other dozen programs where the grid is datasourced by a .xsd
    > dataset? Why doesn't the grid contents (as changed by the user) exist in
    > the click event?
    > Thanks,
    > T
    >

    Scott M. Guest

  4. #3

    Default Re: DataGrid Won't come back

    Do you mean in the Page_Load event if isPostBack is true?
    I have never done that before in any of my successful program but I tried it
    anyway in this one but nothing was changed. Everything that was built in
    the grid is gone.

    T
    "Scott M." <s-mar@nospam.nospam> wrote in message
    news:OlsQVXgxFHA.788@tk2msftngp13.phx.gbl...
    > Did you remember to re-bind the grid in the postback event?
    >
    >
    > "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    > news:uBK$m7TxFHA.3864@TK2MSFTNGP12.phx.gbl...
    >> (please ignore my earlier post - it apparently had nothing to do with it
    >> being in an ascx control)
    >>
    >> I have, dozens of times, displayed datagrids, datasourced by an .xsd
    >> dataset, with textboxes in template columns and always been able to spin
    >> through those grids on, say a button click event.
    >>
    >> In a new project I am dynamicaly populating the datagrid columns, after
    >> which I retrieve data and do the following...
    >>
    >> da.fill(DataSet1) 'this is an untyped dataset
    >> dg.datasource = DataSet1
    >> dg.Databind()
    >>
    >> At this point my datagrid displays exactly like I want it to.
    >>
    >> BUT, on the button click event (which occurs after the user might changes
    >> some fields) my datagrid is empty!!!!
    >>
    >> This brings up a question: How was it that I am able to get the grid back
    >> in my other dozen programs where the grid is datasourced by a .xsd
    >> dataset? Why doesn't the grid contents (as changed by the user) exist in
    >> the click event?
    >> Thanks,
    >> T
    >>
    >
    >

    Tina Guest

  5. #4

    Default Re: DataGrid Won't come back

    No, not in the Postback. In the event handler that caused the postback.
    What button is being clicked that causes the grid to postback to the server
    (Edit, Delete, Update, Cancel)? That's where you need it.


    "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    news:uXDYvbhxFHA.2516@TK2MSFTNGP12.phx.gbl...
    > Do you mean in the Page_Load event if isPostBack is true?
    > I have never done that before in any of my successful program but I tried
    > it anyway in this one but nothing was changed. Everything that was built
    > in the grid is gone.
    >
    > T
    > "Scott M." <s-mar@nospam.nospam> wrote in message
    > news:OlsQVXgxFHA.788@tk2msftngp13.phx.gbl...
    >> Did you remember to re-bind the grid in the postback event?
    >>
    >>
    >> "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    >> news:uBK$m7TxFHA.3864@TK2MSFTNGP12.phx.gbl...
    >>> (please ignore my earlier post - it apparently had nothing to do with it
    >>> being in an ascx control)
    >>>
    >>> I have, dozens of times, displayed datagrids, datasourced by an .xsd
    >>> dataset, with textboxes in template columns and always been able to spin
    >>> through those grids on, say a button click event.
    >>>
    >>> In a new project I am dynamicaly populating the datagrid columns, after
    >>> which I retrieve data and do the following...
    >>>
    >>> da.fill(DataSet1) 'this is an untyped dataset
    >>> dg.datasource = DataSet1
    >>> dg.Databind()
    >>>
    >>> At this point my datagrid displays exactly like I want it to.
    >>>
    >>> BUT, on the button click event (which occurs after the user might
    >>> changes some fields) my datagrid is empty!!!!
    >>>
    >>> This brings up a question: How was it that I am able to get the grid
    >>> back in my other dozen programs where the grid is datasourced by a .xsd
    >>> dataset? Why doesn't the grid contents (as changed by the user) exist in
    >>> the click event?
    >>> Thanks,
    >>> T
    >>>
    >>
    >>
    >
    >

    Scott M. Guest

  6. #5

    Default Re: DataGrid Won't come back

    ....And, is the grid's data source property being set in Page_Load (but
    outside of the If Not IsPostBack statement?


    "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    news:uXDYvbhxFHA.2516@TK2MSFTNGP12.phx.gbl...
    > Do you mean in the Page_Load event if isPostBack is true?
    > I have never done that before in any of my successful program but I tried
    > it anyway in this one but nothing was changed. Everything that was built
    > in the grid is gone.
    >
    > T
    > "Scott M." <s-mar@nospam.nospam> wrote in message
    > news:OlsQVXgxFHA.788@tk2msftngp13.phx.gbl...
    >> Did you remember to re-bind the grid in the postback event?
    >>
    >>
    >> "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    >> news:uBK$m7TxFHA.3864@TK2MSFTNGP12.phx.gbl...
    >>> (please ignore my earlier post - it apparently had nothing to do with it
    >>> being in an ascx control)
    >>>
    >>> I have, dozens of times, displayed datagrids, datasourced by an .xsd
    >>> dataset, with textboxes in template columns and always been able to spin
    >>> through those grids on, say a button click event.
    >>>
    >>> In a new project I am dynamicaly populating the datagrid columns, after
    >>> which I retrieve data and do the following...
    >>>
    >>> da.fill(DataSet1) 'this is an untyped dataset
    >>> dg.datasource = DataSet1
    >>> dg.Databind()
    >>>
    >>> At this point my datagrid displays exactly like I want it to.
    >>>
    >>> BUT, on the button click event (which occurs after the user might
    >>> changes some fields) my datagrid is empty!!!!
    >>>
    >>> This brings up a question: How was it that I am able to get the grid
    >>> back in my other dozen programs where the grid is datasourced by a .xsd
    >>> dataset? Why doesn't the grid contents (as changed by the user) exist in
    >>> the click event?
    >>> Thanks,
    >>> T
    >>>
    >>
    >>
    >
    >

    Scott M. Guest

  7. #6

    Default Re: DataGrid Won't come back

    Scott:
    Thanks for the help but I have now found that if I check the "Create columns
    automatically at run time" checkbox in the datagrid property builder, the
    data grid is there on the click event without having to do anything else.

    So, I've made progress on my problem and made a new post about the Columns
    collection not being there in this case.

    Thanks,
    T

    "Scott M." <s-mar@nospam.nospam> wrote in message
    news:OtSWMfixFHA.3588@tk2msftngp13.phx.gbl...
    > No, not in the Postback. In the event handler that caused the postback.
    > What button is being clicked that causes the grid to postback to the
    > server (Edit, Delete, Update, Cancel)? That's where you need it.
    >
    >
    > "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    > news:uXDYvbhxFHA.2516@TK2MSFTNGP12.phx.gbl...
    >> Do you mean in the Page_Load event if isPostBack is true?
    >> I have never done that before in any of my successful program but I tried
    >> it anyway in this one but nothing was changed. Everything that was built
    >> in the grid is gone.
    >>
    >> T
    >> "Scott M." <s-mar@nospam.nospam> wrote in message
    >> news:OlsQVXgxFHA.788@tk2msftngp13.phx.gbl...
    >>> Did you remember to re-bind the grid in the postback event?
    >>>
    >>>
    >>> "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    >>> news:uBK$m7TxFHA.3864@TK2MSFTNGP12.phx.gbl...
    >>>> (please ignore my earlier post - it apparently had nothing to do with
    >>>> it being in an ascx control)
    >>>>
    >>>> I have, dozens of times, displayed datagrids, datasourced by an .xsd
    >>>> dataset, with textboxes in template columns and always been able to
    >>>> spin through those grids on, say a button click event.
    >>>>
    >>>> In a new project I am dynamicaly populating the datagrid columns, after
    >>>> which I retrieve data and do the following...
    >>>>
    >>>> da.fill(DataSet1) 'this is an untyped dataset
    >>>> dg.datasource = DataSet1
    >>>> dg.Databind()
    >>>>
    >>>> At this point my datagrid displays exactly like I want it to.
    >>>>
    >>>> BUT, on the button click event (which occurs after the user might
    >>>> changes some fields) my datagrid is empty!!!!
    >>>>
    >>>> This brings up a question: How was it that I am able to get the grid
    >>>> back in my other dozen programs where the grid is datasourced by a .xsd
    >>>> dataset? Why doesn't the grid contents (as changed by the user) exist
    >>>> in the click event?
    >>>> Thanks,
    >>>> T
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >

    Tina Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139