Damnit, Jim. Where is my data?!

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

  1. #1

    Default Damnit, Jim. Where is my data?!

    I am binding an array of objects to a datagrid and storing an internal ID in
    a hidden column in my datagrid for updating the database. All is well while
    I'm testing it out. But, as soon as I turn the column's visible property to
    "False" the data disappears!! I tried it with a template column AND a
    databound column!! What gives? How do I retrieve the value?

    Thanks
    Scott


    Scott M Guest

  2. Similar Questions and Discussions

    1. Flash! Linux! Firefox! NOW, DAMNIT!
      Sorry for such harsh words, but you guys at Macromedia have let us Linux users down. I too am a software developer. Though I don't know Flash as...
    2. Linking data, searching data, and format the data file
      I'm sorta new to flash and integrating data and components...I'm usu. an interface designer. I'm trying to link a combo box to a file doesn't...
    3. Load xml data in sepearate mxml file and Populate data
      I am working on a dynamic Tilelist control that will populate a data and show image under each tile from another mxml file which itself contain de...
    4. Display data from database in a scrollable data grid on an ASP Page
      Hi All, I want to display data from database in a scrollable data grid on an ASP Page. I want to use it for entering data also. Should i have to...
    5. abnormal program termination with dynamic data, but not with fixed data
      hi everyone. I am stumped! I have code that is part of a simple persistent object manager. The system takes an object, builds an update...
  3. #2

    Default RE: Damnit, Jim. Where is my data?!

    Hi Scott,

    Welcome to ASP.NET newsgroup.
    Regarding on the problem you met when try retrieving value from invisble
    Column in DataGrid, it is caused by the DataGrid's processing on invisible
    column. DataGrid won't render the content for Columns that are set to
    invisible.
    So for your secnario, if we need to store additional data in each row (to
    be used latter in postback event), we can consider either of the following
    means:

    1. Still use TemplateColumn, but don't set the whole column to invisible,
    but put a inner sub control (which hold the additional value) and set this
    inner control to invisible. (I'll recommend the HtmlInputHIdden html
    control) Then, in the postback event, we can use DataGridItem(or sub
    cell)'s find control to retrieve the control and its held data.

    2. all the Control instance in asp.net has the Attributes collection which
    will be persisted in the ViewState by default. So we can also use this
    collection(e.g, use the DataGrieItem's Attirbutes collection to store the
    value we want). The storeing code can be put in the DataGrid's
    ItemDataBound event.

    Just some of my suggestions. Hope helps. Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)









    --------------------
    | From: "Scott M" <scott_M@nospam.nospam>
    | Subject: Damnit, Jim. Where is my data?!
    | Date: Thu, 1 Sep 2005 02:32:07 -0500
    | Lines: 10
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | format=flowed;
    | charset="iso-8859-1";
    | reply-type=original
    | Content-Transfer-Encoding: 7bit
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    | Message-ID: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    68.209.157.50
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5441
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    |
    | I am binding an array of objects to a datagrid and storing an internal ID
    in
    | a hidden column in my datagrid for updating the database. All is well
    while
    | I'm testing it out. But, as soon as I turn the column's visible property
    to
    | "False" the data disappears!! I tried it with a template column AND a
    | databound column!! What gives? How do I retrieve the value?
    |
    | Thanks
    | Scott
    |
    |
    |

    Steven Cheng[MSFT] Guest

  4. #3

    Default Re: Damnit, Jim. Where is my data?!

    Scott,

    Setting the column's Visible property to false results in not sending the
    column to the client in the first place. That's why you don't get any value
    on postback. You should hide the column with css rule display:none.

    Eliyahu

    "Scott M" <scott_M@nospam.nospam> wrote in message
    news:ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl...
    > I am binding an array of objects to a datagrid and storing an internal ID
    in
    > a hidden column in my datagrid for updating the database. All is well
    while
    > I'm testing it out. But, as soon as I turn the column's visible property
    to
    > "False" the data disappears!! I tried it with a template column AND a
    > databound column!! What gives? How do I retrieve the value?
    >
    > Thanks
    > Scott
    >
    >

    Eliyahu Goldin Guest

  5. #4

    Default Re: Damnit, Jim. Where is my data?!

    Thanks much, Steven. I'll give this a try and let you know how it goes.

    "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
    news:utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl...
    > Hi Scott,
    >
    > Welcome to ASP.NET newsgroup.
    > Regarding on the problem you met when try retrieving value from invisble
    > Column in DataGrid, it is caused by the DataGrid's processing on invisible
    > column. DataGrid won't render the content for Columns that are set to
    > invisible.
    > So for your secnario, if we need to store additional data in each row (to
    > be used latter in postback event), we can consider either of the following
    > means:
    >
    > 1. Still use TemplateColumn, but don't set the whole column to invisible,
    > but put a inner sub control (which hold the additional value) and set this
    > inner control to invisible. (I'll recommend the HtmlInputHIdden html
    > control) Then, in the postback event, we can use DataGridItem(or sub
    > cell)'s find control to retrieve the control and its held data.
    >
    > 2. all the Control instance in asp.net has the Attributes collection which
    > will be persisted in the ViewState by default. So we can also use this
    > collection(e.g, use the DataGrieItem's Attirbutes collection to store the
    > value we want). The storeing code can be put in the DataGrid's
    > ItemDataBound event.
    >
    > Just some of my suggestions. Hope helps. Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! [url]www.microsoft.com/security[/url]
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > --------------------
    > | From: "Scott M" <scott_M@nospam.nospam>
    > | Subject: Damnit, Jim. Where is my data?!
    > | Date: Thu, 1 Sep 2005 02:32:07 -0500
    > | Lines: 10
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | format=flowed;
    > | charset="iso-8859-1";
    > | reply-type=original
    > | Content-Transfer-Encoding: 7bit
    > | X-Priority: 3
    > | X-MSMail-Priority: Normal
    > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    > | Message-ID: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    > 68.209.157.50
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5441
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > |
    > | I am binding an array of objects to a datagrid and storing an internal
    > ID
    > in
    > | a hidden column in my datagrid for updating the database. All is well
    > while
    > | I'm testing it out. But, as soon as I turn the column's visible
    > property
    > to
    > | "False" the data disappears!! I tried it with a template column AND a
    > | databound column!! What gives? How do I retrieve the value?
    > |
    > | Thanks
    > | Scott
    > |
    > |
    > |
    >
    Scott M Guest

  6. #5

    Default Re: Damnit, Jim. Where is my data?!

    You're welcome Scott,

    If anything else we can help, please feel free to post here.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | From: "Scott M" <scott_M@nospam.nospam>
    | References: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    <utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl>
    | Subject: Re: Damnit, Jim. Where is my data?!
    | Date: Fri, 16 Sep 2005 14:00:52 -0500
    | Lines: 86
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | format=flowed;
    | charset="iso-8859-1";
    | reply-type=original
    | Content-Transfer-Encoding: 7bit
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    | Message-ID: <eudwtfwuFHA.3528@TK2MSFTNGP15.phx.gbl>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    68.209.157.50
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5553
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    |
    | Thanks much, Steven. I'll give this a try and let you know how it goes.
    |
    | "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
    | news:utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl...
    | > Hi Scott,
    | >
    | > Welcome to ASP.NET newsgroup.
    | > Regarding on the problem you met when try retrieving value from invisble
    | > Column in DataGrid, it is caused by the DataGrid's processing on
    invisible
    | > column. DataGrid won't render the content for Columns that are set to
    | > invisible.
    | > So for your secnario, if we need to store additional data in each row
    (to
    | > be used latter in postback event), we can consider either of the
    following
    | > means:
    | >
    | > 1. Still use TemplateColumn, but don't set the whole column to
    invisible,
    | > but put a inner sub control (which hold the additional value) and set
    this
    | > inner control to invisible. (I'll recommend the HtmlInputHIdden html
    | > control) Then, in the postback event, we can use DataGridItem(or sub
    | > cell)'s find control to retrieve the control and its held data.
    | >
    | > 2. all the Control instance in asp.net has the Attributes collection
    which
    | > will be persisted in the ViewState by default. So we can also use this
    | > collection(e.g, use the DataGrieItem's Attirbutes collection to store
    the
    | > value we want). The storeing code can be put in the DataGrid's
    | > ItemDataBound event.
    | >
    | > Just some of my suggestions. Hope helps. Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! [url]www.microsoft.com/security[/url]
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | >
    | >
    | >
    | >
    | >
    | >
    | >
    | > --------------------
    | > | From: "Scott M" <scott_M@nospam.nospam>
    | > | Subject: Damnit, Jim. Where is my data?!
    | > | Date: Thu, 1 Sep 2005 02:32:07 -0500
    | > | Lines: 10
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain;
    | > | format=flowed;
    | > | charset="iso-8859-1";
    | > | reply-type=original
    | > | Content-Transfer-Encoding: 7bit
    | > | X-Priority: 3
    | > | X-MSMail-Priority: Normal
    | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    | > | Message-ID: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | > | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    | > 68.209.157.50
    | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5441
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | > |
    | > | I am binding an array of objects to a datagrid and storing an
    internal
    | > ID
    | > in
    | > | a hidden column in my datagrid for updating the database. All is well
    | > while
    | > | I'm testing it out. But, as soon as I turn the column's visible
    | > property
    | > to
    | > | "False" the data disappears!! I tried it with a template column AND a
    | > | databound column!! What gives? How do I retrieve the value?
    | > |
    | > | Thanks
    | > | Scott
    | > |
    | > |
    | > |
    | >
    |
    |

    Steven Cheng[MSFT] Guest

  7. #6

    Default Re: Damnit, Jim. Where is my data?!

    You rock. The hidden input field is what I needed :)

    Thanks much!

    "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
    news:p99w9lLvFHA.1364@TK2MSFTNGXA01.phx.gbl...
    > You're welcome Scott,
    >
    > If anything else we can help, please feel free to post here.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! [url]www.microsoft.com/security[/url]
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    > --------------------
    > | From: "Scott M" <scott_M@nospam.nospam>
    > | References: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    > <utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl>
    > | Subject: Re: Damnit, Jim. Where is my data?!
    > | Date: Fri, 16 Sep 2005 14:00:52 -0500
    > | Lines: 86
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | format=flowed;
    > | charset="iso-8859-1";
    > | reply-type=original
    > | Content-Transfer-Encoding: 7bit
    > | X-Priority: 3
    > | X-MSMail-Priority: Normal
    > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    > | Message-ID: <eudwtfwuFHA.3528@TK2MSFTNGP15.phx.gbl>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    > 68.209.157.50
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5553
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > |
    > | Thanks much, Steven. I'll give this a try and let you know how it goes.
    > |
    > | "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
    > | news:utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl...
    > | > Hi Scott,
    > | >
    > | > Welcome to ASP.NET newsgroup.
    > | > Regarding on the problem you met when try retrieving value from
    > invisble
    > | > Column in DataGrid, it is caused by the DataGrid's processing on
    > invisible
    > | > column. DataGrid won't render the content for Columns that are set to
    > | > invisible.
    > | > So for your secnario, if we need to store additional data in each row
    > (to
    > | > be used latter in postback event), we can consider either of the
    > following
    > | > means:
    > | >
    > | > 1. Still use TemplateColumn, but don't set the whole column to
    > invisible,
    > | > but put a inner sub control (which hold the additional value) and set
    > this
    > | > inner control to invisible. (I'll recommend the HtmlInputHIdden html
    > | > control) Then, in the postback event, we can use DataGridItem(or sub
    > | > cell)'s find control to retrieve the control and its held data.
    > | >
    > | > 2. all the Control instance in asp.net has the Attributes collection
    > which
    > | > will be persisted in the ViewState by default. So we can also use this
    > | > collection(e.g, use the DataGrieItem's Attirbutes collection to store
    > the
    > | > value we want). The storeing code can be put in the DataGrid's
    > | > ItemDataBound event.
    > | >
    > | > Just some of my suggestions. Hope helps. Thanks,
    > | >
    > | > Steven Cheng
    > | > Microsoft Online Support
    > | >
    > | > Get Secure! [url]www.microsoft.com/security[/url]
    > | > (This posting is provided "AS IS", with no warranties, and confers no
    > | > rights.)
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | > --------------------
    > | > | From: "Scott M" <scott_M@nospam.nospam>
    > | > | Subject: Damnit, Jim. Where is my data?!
    > | > | Date: Thu, 1 Sep 2005 02:32:07 -0500
    > | > | Lines: 10
    > | > | MIME-Version: 1.0
    > | > | Content-Type: text/plain;
    > | > | format=flowed;
    > | > | charset="iso-8859-1";
    > | > | reply-type=original
    > | > | Content-Transfer-Encoding: 7bit
    > | > | X-Priority: 3
    > | > | X-MSMail-Priority: Normal
    > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    > | > | Message-ID: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > | > | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    > | > 68.209.157.50
    > | > | Path:
    > TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
    > | > | Xref: TK2MSFTNGXA01.phx.gbl
    > | > microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5441
    > | > | X-Tomcat-NG:
    > microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > | > |
    > | > | I am binding an array of objects to a datagrid and storing an
    > internal
    > | > ID
    > | > in
    > | > | a hidden column in my datagrid for updating the database. All is
    > well
    > | > while
    > | > | I'm testing it out. But, as soon as I turn the column's visible
    > | > property
    > | > to
    > | > | "False" the data disappears!! I tried it with a template column AND
    > a
    > | > | databound column!! What gives? How do I retrieve the value?
    > | > |
    > | > | Thanks
    > | > | Scott
    > | > |
    > | > |
    > | > |
    > | >
    > |
    > |
    >
    Scott M Guest

  8. #7

    Default Re: Damnit, Jim. Where is my data?!

    My pleasure:-)

    Have a nice day!

    Steven Cheng
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | From: "Scott M" <scott_M@nospam.nospam>
    | References: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    <utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl>
    <eudwtfwuFHA.3528@TK2MSFTNGP15.phx.gbl>
    <p99w9lLvFHA.1364@TK2MSFTNGXA01.phx.gbl>
    | Subject: Re: Damnit, Jim. Where is my data?!
    | Date: Thu, 22 Sep 2005 00:08:40 -0500
    | Lines: 146
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | format=flowed;
    | charset="iso-8859-1";
    | reply-type=original
    | Content-Transfer-Encoding: 7bit
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    | Message-ID: <OlPYNOzvFHA.3720@TK2MSFTNGP14.phx.gbl>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    68.209.157.50
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP14.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5603
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    |
    | You rock. The hidden input field is what I needed :)
    |
    | Thanks much!
    |
    | "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
    | news:p99w9lLvFHA.1364@TK2MSFTNGXA01.phx.gbl...
    | > You're welcome Scott,
    | >
    | > If anything else we can help, please feel free to post here.
    | >
    | > Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! [url]www.microsoft.com/security[/url]
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | > --------------------
    | > | From: "Scott M" <scott_M@nospam.nospam>
    | > | References: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    | > <utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl>
    | > | Subject: Re: Damnit, Jim. Where is my data?!
    | > | Date: Fri, 16 Sep 2005 14:00:52 -0500
    | > | Lines: 86
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain;
    | > | format=flowed;
    | > | charset="iso-8859-1";
    | > | reply-type=original
    | > | Content-Transfer-Encoding: 7bit
    | > | X-Priority: 3
    | > | X-MSMail-Priority: Normal
    | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    | > | Message-ID: <eudwtfwuFHA.3528@TK2MSFTNGP15.phx.gbl>
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | > | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    | > 68.209.157.50
    | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5553
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | > |
    | > | Thanks much, Steven. I'll give this a try and let you know how it
    goes.
    | > |
    | > | "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
    | > | news:utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl...
    | > | > Hi Scott,
    | > | >
    | > | > Welcome to ASP.NET newsgroup.
    | > | > Regarding on the problem you met when try retrieving value from
    | > invisble
    | > | > Column in DataGrid, it is caused by the DataGrid's processing on
    | > invisible
    | > | > column. DataGrid won't render the content for Columns that are set
    to
    | > | > invisible.
    | > | > So for your secnario, if we need to store additional data in each
    row
    | > (to
    | > | > be used latter in postback event), we can consider either of the
    | > following
    | > | > means:
    | > | >
    | > | > 1. Still use TemplateColumn, but don't set the whole column to
    | > invisible,
    | > | > but put a inner sub control (which hold the additional value) and
    set
    | > this
    | > | > inner control to invisible. (I'll recommend the HtmlInputHIdden html
    | > | > control) Then, in the postback event, we can use DataGridItem(or
    sub
    | > | > cell)'s find control to retrieve the control and its held data.
    | > | >
    | > | > 2. all the Control instance in asp.net has the Attributes collection
    | > which
    | > | > will be persisted in the ViewState by default. So we can also use
    this
    | > | > collection(e.g, use the DataGrieItem's Attirbutes collection to
    store
    | > the
    | > | > value we want). The storeing code can be put in the DataGrid's
    | > | > ItemDataBound event.
    | > | >
    | > | > Just some of my suggestions. Hope helps. Thanks,
    | > | >
    | > | > Steven Cheng
    | > | > Microsoft Online Support
    | > | >
    | > | > Get Secure! [url]www.microsoft.com/security[/url]
    | > | > (This posting is provided "AS IS", with no warranties, and confers
    no
    | > | > rights.)
    | > | >
    | > | >
    | > | >
    | > | >
    | > | >
    | > | >
    | > | >
    | > | >
    | > | >
    | > | > --------------------
    | > | > | From: "Scott M" <scott_M@nospam.nospam>
    | > | > | Subject: Damnit, Jim. Where is my data?!
    | > | > | Date: Thu, 1 Sep 2005 02:32:07 -0500
    | > | > | Lines: 10
    | > | > | MIME-Version: 1.0
    | > | > | Content-Type: text/plain;
    | > | > | format=flowed;
    | > | > | charset="iso-8859-1";
    | > | > | reply-type=original
    | > | > | Content-Transfer-Encoding: 7bit
    | > | > | X-Priority: 3
    | > | > | X-MSMail-Priority: Normal
    | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    | > | > | Message-ID: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    | > | > | Newsgroups:
    microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | > | > | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    | > | > 68.209.157.50
    | > | > | Path:
    | > TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
    | > | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > | > microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5441
    | > | > | X-Tomcat-NG:
    | > microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    | > | > |
    | > | > | I am binding an array of objects to a datagrid and storing an
    | > internal
    | > | > ID
    | > | > in
    | > | > | a hidden column in my datagrid for updating the database. All is
    | > well
    | > | > while
    | > | > | I'm testing it out. But, as soon as I turn the column's visible
    | > | > property
    | > | > to
    | > | > | "False" the data disappears!! I tried it with a template column
    AND
    | > a
    | > | > | databound column!! What gives? How do I retrieve the value?
    | > | > |
    | > | > | Thanks
    | > | > | Scott
    | > | > |
    | > | > |
    | > | > |
    | > | >
    | > |
    | > |
    | >
    |
    |

    Steven Cheng[MSFT] Guest

  9. #8

    Default Re: Damnit, Jim. Where is my data?!

    The hidden field worked awesome!! Thanks!

    "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
    news:p99w9lLvFHA.1364@TK2MSFTNGXA01.phx.gbl...
    > You're welcome Scott,
    >
    > If anything else we can help, please feel free to post here.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! [url]www.microsoft.com/security[/url]
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    > --------------------
    > | From: "Scott M" <scott_M@nospam.nospam>
    > | References: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    > <utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl>
    > | Subject: Re: Damnit, Jim. Where is my data?!
    > | Date: Fri, 16 Sep 2005 14:00:52 -0500
    > | Lines: 86
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | format=flowed;
    > | charset="iso-8859-1";
    > | reply-type=original
    > | Content-Transfer-Encoding: 7bit
    > | X-Priority: 3
    > | X-MSMail-Priority: Normal
    > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    > | Message-ID: <eudwtfwuFHA.3528@TK2MSFTNGP15.phx.gbl>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    > 68.209.157.50
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5553
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > |
    > | Thanks much, Steven. I'll give this a try and let you know how it goes.
    > |
    > | "Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
    > | news:utVnImtrFHA.1204@TK2MSFTNGXA01.phx.gbl...
    > | > Hi Scott,
    > | >
    > | > Welcome to ASP.NET newsgroup.
    > | > Regarding on the problem you met when try retrieving value from
    > invisble
    > | > Column in DataGrid, it is caused by the DataGrid's processing on
    > invisible
    > | > column. DataGrid won't render the content for Columns that are set to
    > | > invisible.
    > | > So for your secnario, if we need to store additional data in each row
    > (to
    > | > be used latter in postback event), we can consider either of the
    > following
    > | > means:
    > | >
    > | > 1. Still use TemplateColumn, but don't set the whole column to
    > invisible,
    > | > but put a inner sub control (which hold the additional value) and set
    > this
    > | > inner control to invisible. (I'll recommend the HtmlInputHIdden html
    > | > control) Then, in the postback event, we can use DataGridItem(or sub
    > | > cell)'s find control to retrieve the control and its held data.
    > | >
    > | > 2. all the Control instance in asp.net has the Attributes collection
    > which
    > | > will be persisted in the ViewState by default. So we can also use this
    > | > collection(e.g, use the DataGrieItem's Attirbutes collection to store
    > the
    > | > value we want). The storeing code can be put in the DataGrid's
    > | > ItemDataBound event.
    > | >
    > | > Just some of my suggestions. Hope helps. Thanks,
    > | >
    > | > Steven Cheng
    > | > Microsoft Online Support
    > | >
    > | > Get Secure! [url]www.microsoft.com/security[/url]
    > | > (This posting is provided "AS IS", with no warranties, and confers no
    > | > rights.)
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | >
    > | > --------------------
    > | > | From: "Scott M" <scott_M@nospam.nospam>
    > | > | Subject: Damnit, Jim. Where is my data?!
    > | > | Date: Thu, 1 Sep 2005 02:32:07 -0500
    > | > | Lines: 10
    > | > | MIME-Version: 1.0
    > | > | Content-Type: text/plain;
    > | > | format=flowed;
    > | > | charset="iso-8859-1";
    > | > | reply-type=original
    > | > | Content-Transfer-Encoding: 7bit
    > | > | X-Priority: 3
    > | > | X-MSMail-Priority: Normal
    > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
    > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
    > | > | Message-ID: <ejaUDdsrFHA.3264@TK2MSFTNGP12.phx.gbl>
    > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > | > | NNTP-Posting-Host: adsl-068-209-157-050.sip.lft.bellsouth.net
    > | > 68.209.157.50
    > | > | Path:
    > TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
    > | > | Xref: TK2MSFTNGXA01.phx.gbl
    > | > microsoft.public.dotnet.framework.aspnet.datagridc ontrol:5441
    > | > | X-Tomcat-NG:
    > microsoft.public.dotnet.framework.aspnet.datagridc ontrol
    > | > |
    > | > | I am binding an array of objects to a datagrid and storing an
    > internal
    > | > ID
    > | > in
    > | > | a hidden column in my datagrid for updating the database. All is
    > well
    > | > while
    > | > | I'm testing it out. But, as soon as I turn the column's visible
    > | > property
    > | > to
    > | > | "False" the data disappears!! I tried it with a template column AND
    > a
    > | > | databound column!! What gives? How do I retrieve the value?
    > | > |
    > | > | Thanks
    > | > | Scott
    > | > |
    > | > |
    > | > |
    > | >
    > |
    > |
    >
    Scott M 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