473,386 Members | 1,795 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,386 software developers and data experts.

How to 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!

Aug 10 '05 #1
1 1558
hB
1. xml http sockets.
2. in dotnet 2, i think grid can refresh only itself and not the whole
page
3. remote script.

---
hB

Aug 10 '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...
4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
2
by: Simon Storr | last post by:
Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a 'normal' window, but this doesn't work for...
7
by: Bryan G | last post by:
I need to force the client side to refresh the page. What function do I use todo this in C# with a ASPX page?
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...
4
by: sandhya.net | last post by:
Hi, I have a dropdown which displays the Products and Add button on my Asp.net web page. When the user selects a product from the dropdown and Clicks the add button it adds the selected product...
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: 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: Andy | last post by:
My application is written in .NET (C#) with the inline Edit mode from DataGrid. When a SAVE button is pressed it will perform a action on the database either to add, edit or delete data that a user...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.