HighTechTalks DotNet Forums  

Datagrid ClientID Numbering Problem

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Datagrid ClientID Numbering Problem in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Aminoplacid
 
Posts: n/a

Default Datagrid ClientID Numbering Problem - 08-17-2006 , 12:57 PM






Hi,
I had been working on a highly customized .NET 1.1 datagrid for a
project with lots of javascript iterating through my datagrid. I had
installed .NET 2.0 a while back and no problems. I had installed SQL
Server Management Studio: no problems. I had just installed Visual
Studio 2005 yesterday (for Reporting Services) and now when I run my
application (from VS 2003), the datagrid numbering format is all
screwy. For rows 1-9, the format was
[datagridid]__ctl[rownum]_[itemid]. Now it is
[datagridid]__ctl0[rownum]_[itemid]. For example,
grdDataGrd__ctl2_ItemName is now grdDataGrd__ctl02_ItemName.
I had installed my app on my managers laptop (2 weeks prior) and got
the same behavior, too.
Any ideas why this is? What can I do short of rewriting all my
javascript to accomodate this? Anyone else come across this?
Thanks for the ideas.
Derek Baker


Reply With Quote
  #2  
Old   
Teemu Keiski
 
Posts: n/a

Default Re: Datagrid ClientID Numbering Problem - 08-26-2006 , 05:39 AM






Hi,

ClientID property of a control gives you the ID which is used at client-side
as id for scripting. It mean you should design your javascript so that they
can take in references to DOM objects (or ida) and these references(or ids)
are passed by generating scripts at server-side utilizing ClientID property
of a control. For example to output a javascript array consisting of all ids
of TextBoxes located in a gridView.

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

"Aminoplacid" <derekb10101 (AT) gmail (DOT) com> wrote

Quote:
Hi,
I had been working on a highly customized .NET 1.1 datagrid for a
project with lots of javascript iterating through my datagrid. I had
installed .NET 2.0 a while back and no problems. I had installed SQL
Server Management Studio: no problems. I had just installed Visual
Studio 2005 yesterday (for Reporting Services) and now when I run my
application (from VS 2003), the datagrid numbering format is all
screwy. For rows 1-9, the format was
[datagridid]__ctl[rownum]_[itemid]. Now it is
[datagridid]__ctl0[rownum]_[itemid]. For example,
grdDataGrd__ctl2_ItemName is now grdDataGrd__ctl02_ItemName.
I had installed my app on my managers laptop (2 weeks prior) and got
the same behavior, too.
Any ideas why this is? What can I do short of rewriting all my
javascript to accomodate this? Anyone else come across this?
Thanks for the ideas.
Derek Baker




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.