Home All Groups Group Topic Archive Search About

client retrieval from GridView cell values that are in an UpdatePa

Author
31 Aug 2007 9:00 PM
thoward
I am working with ASP.NET 2.0 c# and Ajax control (UpdatePanel).  The
GridView Control is nested within an updatePanel Control which is populated
using the partial post-back method.  I am needing to extract the GridView
Cell values from items that are selected and post them into another table all
on the client side. 

The issue that I have is that I cannot access the GridView Control through
the client-side as I normally would
(document.GetElementById('GridView1').rows[0].cells[0].innerText)

The value that is returned for the basic control value of
(document.GetElementById('GridView1')) = NULL!

Is it the UpdatePanel that makes this method of Data Retrieval break?  How
do I get around this?

Thank you in advance for your Help.

TH
--
....and that was the rest of the story!!

Author
2 Sep 2007 7:08 AM
Teemu Keiski
Hi,

you'd use document.getElementById('...')

It is case-sensitive since client-scripting is done in javascript.


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net



Show quote
"thoward" <thow***@discussions.microsoft.com> wrote in message
news:3237F8F9-B386-4B19-A7A4-AD491525E308@microsoft.com...
>I am working with ASP.NET 2.0 c# and Ajax control (UpdatePanel).  The
> GridView Control is nested within an updatePanel Control which is
> populated
> using the partial post-back method.  I am needing to extract the GridView
> Cell values from items that are selected and post them into another table
> all
> on the client side.
>
> The issue that I have is that I cannot access the GridView Control through
> the client-side as I normally would
> (document.GetElementById('GridView1').rows[0].cells[0].innerText)
>
> The value that is returned for the basic control value of
> (document.GetElementById('GridView1')) = NULL!
>
> Is it the UpdatePanel that makes this method of Data Retrieval break?  How
> do I get around this?
>
> Thank you in advance for your Help.
>
> TH
> --
> ...and that was the rest of the story!!
Author
4 Sep 2007 1:50 PM
thoward
That is what I used in the correct syntax, unlike what I have listed in my
original post, however ist returns a null value for the object in question. 

Are there any other suggestions?  Does the partial update, of the
UpdatePanel, effect the format of a Gridview?

Thank you,
TH
--
....and that was the rest of the story!!


Show quote
"Teemu Keiski" wrote:

> Hi,
>
> you'd use document.getElementById('...')
>
> It is case-sensitive since client-scripting is done in javascript.
>
>
> --
> Teemu Keiski
> AspInsider, ASP.NET MVP
> http://blogs.aspadvice.com/joteke
> http://teemukeiski.net
>
>
>
> "thoward" <thow***@discussions.microsoft.com> wrote in message
> news:3237F8F9-B386-4B19-A7A4-AD491525E308@microsoft.com...
> >I am working with ASP.NET 2.0 c# and Ajax control (UpdatePanel).  The
> > GridView Control is nested within an updatePanel Control which is
> > populated
> > using the partial post-back method.  I am needing to extract the GridView
> > Cell values from items that are selected and post them into another table
> > all
> > on the client side.
> >
> > The issue that I have is that I cannot access the GridView Control through
> > the client-side as I normally would
> > (document.GetElementById('GridView1').rows[0].cells[0].innerText)
> >
> > The value that is returned for the basic control value of
> > (document.GetElementById('GridView1')) = NULL!
> >
> > Is it the UpdatePanel that makes this method of Data Retrieval break?  How
> > do I get around this?
> >
> > Thank you in advance for your Help.
> >
> > TH
> > --
> > ...and that was the rest of the story!!
>
>
>
Author
4 Sep 2007 2:42 PM
thoward
Allow me to retort...My Syntax was NOT correct and neither was my identifier.

When using the GridView within an UpdatePanel within a TabPanel within a
TabContainer within a TabContainer  it is necessary to include all levels of
the structure in order to drill down to the GridView Table. 

such as this:
alert(document.getElementById('TabContainer1_ItemToWorkTabPanel_ctl01_TabContainer2_panSearchItems_ctl01_gvItemSearch').rows[2].cells[2].innerText);

Thank you Teemu for pointing me back to the start!
--
....and that was the rest of the story!!


Show quote
"Teemu Keiski" wrote:

> Hi,
>
> you'd use document.getElementById('...')
>
> It is case-sensitive since client-scripting is done in javascript.
>
>
> --
> Teemu Keiski
> AspInsider, ASP.NET MVP
> http://blogs.aspadvice.com/joteke
> http://teemukeiski.net
>
>
>
> "thoward" <thow***@discussions.microsoft.com> wrote in message
> news:3237F8F9-B386-4B19-A7A4-AD491525E308@microsoft.com...
> >I am working with ASP.NET 2.0 c# and Ajax control (UpdatePanel).  The
> > GridView Control is nested within an updatePanel Control which is
> > populated
> > using the partial post-back method.  I am needing to extract the GridView
> > Cell values from items that are selected and post them into another table
> > all
> > on the client side.
> >
> > The issue that I have is that I cannot access the GridView Control through
> > the client-side as I normally would
> > (document.GetElementById('GridView1').rows[0].cells[0].innerText)
> >
> > The value that is returned for the basic control value of
> > (document.GetElementById('GridView1')) = NULL!
> >
> > Is it the UpdatePanel that makes this method of Data Retrieval break?  How
> > do I get around this?
> >
> > Thank you in advance for your Help.
> >
> > TH
> > --
> > ...and that was the rest of the story!!
>
>
>

AddThis Social Bookmark Button