Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / July 2003

Tip: Looking for answers? Try searching our database.

...Accessing a datagrid across frames...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dj Bass - 16 Jul 2003 15:42 GMT
I've got a situaion where there's one frame with a load of buttons, acting
as a small control panel, with a datagrid object existing in another frame.

On clicking on one button on the top frame, I want to be able to access the
instance that is being displayed onscreen of the grid, because it contains,
among other things, a column of check boxes, who's state is lost if i
manually refresh it from the other frame via scripting.

What I want to do is when clicking a button in the top, pick out all items
in the datagrid in the frame below that have been "selected", that is,
checked off.

Any ideas as to an approach for this?
Is there a way, for example, to access the object in another page as it
exists, and drive it externally, calling methods on already existing
instance of that object?

Thanks for your comments.
Daniel.
Vidar Petursson - 16 Jul 2003 19:34 GMT
Hi

I am not totally sure what you want... Do you simply want to store the
checked checkboxes in the other frame?

var myCheckBoxArr = new Array();
function storeCheckedBoxes(){
with(parent.FRAMENAME.document.forms[0])
   {
   for(i=0;i<elements.length;i++)
      {
       if(elements[i].type == "checkbox") if(elements[i].checked)
myCheckBoxArr.push(elements[i].name);
        }
    }
}

This will store the checked checkboxes names in the Array

Or for newer browsers
document.getElementsByTagName("CHECKBOX");

More info
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/referen
ce/methods/getelementsbytagname.asp

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/referen
ce/collections/elements.asp


Signature

Best Regards
 Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================

> I've got a situaion where there's one frame with a load of buttons, acting
> as a small control panel, with a datagrid object existing in another frame.
[quoted text clipped - 15 lines]
> Thanks for your comments.
> Daniel.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.