473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

How do I refresh a datagrid client side

Hi --

I'm very, very new to ASP.Net, and I've been trying for several days to
figure out how to update a datagrid AND refresh it on the client side so
that the page doesn't refresh. I've torn my code apart over and over each
time I tried what I thought would be the code that would solve my problem.

Maybe I'm going down the completely wrong path here. Essentially,
here is an explanation of my ASP.NET webform application and what I
want it to do:

Employees add how much time they spend on a job, and then that
information is added to a SQL database and displayed in a datagrid.
I've got everything working on the client side (we are using an AJAX
approach), except the refreshing
of the datagrid.

When the page loads and/or when a new record is added, I want the
datagrid to update (without the page refreshing). The information
that is returned is in XML format, and I somehow have to get it into
the datagrid.

Here's one record of the XML that is returned into variable
oResult.value:

"<ROOT><NewDataSet>
<ActivityHistory>
<ActivityID>312</ActivityID>
<CustomerName>Test</CustomerName>
<Description>312-Development</Description>
<ActivityDate>2005-08-10T00:00:00.0000000-05:00</ActivityDate>
<ReferenceCode>J-1007</ReferenceCode>
<Minutes>15.00</Minutes>
</ActivityHistory>
</NewDataSet></ROOT>"

But for a given period of time, there will be several of these
ActivityHistory records.

Below is the function I have so far (sorry about the wrapping), but as I
said, I could be going
down a completely wrong path. I would greatly appreciate if any of
you have corrections for my code or if you have ideas/suggestions for
a different/better way to do this (since my way doesn't work,
anything would be better). Yes, I'm a newbie, and I'm just
not "getting" this at all. I have no idea what to do now that
nothing has worked thus far.

function LoadTable()
{

var Employee = document.getElementById
("_ctl1__ctl0_ddlEmployee").value;
var StartDate = document.getElementById
("_ctl1__ctl0_TextStartDate").value;
var EndDate = document.getElementById
("_ctl1__ctl0_TextEndDate").value;

// Update the xml island with the employee history
information
var oResult = Methods.EmployeeActivity(Employee,
StartDate, EndDate);

var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("activityhistory.xml");

var loaded = xmlDoc.loadXML(oResult.value);
if (loaded) {
var xslDoc=new ActiveXObject
("Microsoft.XMLDOM");
xslDoc.async=false;
xslDoc.load("ActivityHistoryStyle.xsl");
document.getElementById
("Table1Inner").innerHTML = xmlDoc.transformNode(xslDoc);
}
}

Thanks!

Nov 21 '05 #1
1 1232
MSNews

The webform datagrid is a ServerSide *data* grid.

In my opinion do you want to use it as an HTML table.

I would than take an HTML table in that case.

Just my idea

Cor
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches...
1
by: msnews | last post by:
Hi -- I'm very, very new to ASP.Net, and I've been trying for several days to figure out how to update a datagrid AND refresh it on the client side so that the page doesn't refresh. I've torn my...
1
by: aliansari | last post by:
HI ... i am facing a problem while refreshing my datagrid ... i am developing a "Real time/Live data Stocks Trading Screen" ... what i want is to refresh my datagrid without refreshing the whole...
1
by: msnews | last post by:
Hi -- I'm very, very new to ASP.Net, and I've been trying for several days to figure out how to update a datagrid AND refresh it on the client side so that the page doesn't refresh. I've torn my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.