Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Scott M #1
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
-
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... -
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... -
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... -
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... -
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... -
Steven Cheng[MSFT] #2
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
-
Eliyahu Goldin #3
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...in> I am binding an array of objects to a datagrid and storing an internal IDwhile> a hidden column in my datagrid for updating the database. All is wellto> I'm testing it out. But, as soon as I turn the column's visible property> "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
-
Scott M #4
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
-
Steven Cheng[MSFT] #5
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
-
Scott M #6
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
-
Steven Cheng[MSFT] #7
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
-
Scott M #8
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



Reply With Quote

