Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to use BingMaps for a web application but I seem to have a brain fart when it comes to Javascript. I have a gridview populated server-side with addresses and Lat/Longs; I need to get read the column of the gridview via Javascript then trigger an 'addpin to map'.

 

I guess I'm drawing a blank on how to get javascript to trigger once the gridview is loaded without additional actions by the user.

 

Enter # -> Query database for all address which match -> Populate Gridview...now trigger javascript ot read columns and add pin to a map.

 

Any help would be greatly appreciated.

Posted (edited)

gridview events and javascript

 

You have not shown any code which makes it difficult to access the context of your question.

 

I'm going to assume you are talking about System.Web.UI.WebControls.GridView.

The MSDN page lists several events, which do not require user interaction, that can be used,

including:

Init, PreRender, Load, and Databound events.

 

Since you are needing the gridview to be populated before the columns are read the Databound event seems the most likely candidate.

 

This client side javascript in this Asp.Net article might be of use,

(which shows how to set up a callback event handler):

Asynchronous GridView in 5 simple steps

 

Further info:

MSDN: Implementing Client Callbacks Programmatically Without Postbacks

 

 

An extra little gridview control "nicety":

I know you, Haak3n, are probably doing this already,

but for many programmers it is often overlooked..

 

A gridview programmer has the responsibility to explicitly set up the control

to make it more accessible to users of assistive technology devices.

 

Of course this means correctly using/setting the UseAccessibleHeader property,

but there is a little more to it if you want the GridView control

to generate the necessary thead, tbody, and th elements.

 

"MSDN Walkthrough: Accessibility Guidelines for Using the GridView Control"

shows how to use javascript to hook into the page load event

and update the page heading caption (depending on a particular

section group the page may display).

Edited by dotnetguy37

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...