473,626 Members | 3,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help refreshing 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><NewData Set>
<ActivityHistor y>
<ActivityID>312 </ActivityID>
<CustomerName>T est</CustomerName>
<Description>31 2-Development</Description>
<ActivityDate>2 005-08-10T00:00:00.000 0000-05:00</ActivityDate>
<ReferenceCode> J-1007</ReferenceCode>
<Minutes>15.0 0</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.getEle mentById
("_ctl1__ctl0_d dlEmployee").va lue;
var StartDate = document.getEle mentById
("_ctl1__ctl0_T extStartDate"). value;
var EndDate = document.getEle mentById
("_ctl1__ctl0_T extEndDate").va lue;

// Update the xml island with the employee history
information
var oResult = Methods.Employe eActivity(Emplo yee,
StartDate, EndDate);

var xmlDoc=new ActiveXObject(" Microsoft.XMLDO M");
xmlDoc.async=fa lse;
xmlDoc.load("ac tivityhistory.x ml");

var loaded = xmlDoc.loadXML( oResult.value);
if (loaded) {
var xslDoc=new ActiveXObject
("Microsoft.XML DOM");
xslDoc.async=fa lse;
xslDoc.load("Ac tivityHistorySt yle.xsl");
document.getEle mentById
("Table1Inner") .innerHTML = xmlDoc.transfor mNode(xslDoc);
}
}

Thanks!

Nov 12 '05 #1
0 1745

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

Similar topics

4
5350
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. Currently everything is working. I can find the updated rows/columns by parsing the posted data collection against the DataGrid DataSource. However, when there is a large amount of DataGridItems (rows) the update processing can take a while. ...
7
3548
by: A.M | last post by:
Hi, I want to refresh my DataGrid data on every postback. I have following code in Page_Load event, but after first page load, the DataGrid never gets refresh. Here is the code i have in Page_load (it works at first page_load): Dim DS As DataSet Dim MyConnection As System.Data.SqlClient.SqlConnection
2
1858
by: Snig | last post by:
Hi, I want to sort the DataGrid according to the number of clicks of mouse on the column-header link. e.g. if user clicks on the header once - it will be sorted ASC if the header is double-clicked - it will be sorted DESC It is not exactly toggling the sorting-order. I have seen a lot of messages and articles in the web about toggling the sort order (like first time click
8
3046
by: Sue | last post by:
I have a datagrid populated with 6 visible read-only labels and several hidden fields. Below the datagrid, I have a table with various textboxes, dropdowns, etc. I've managed to decypher the client-side coding needed for the user to click a "select" button (HTMLButton) in column 0 of the datagrid and have the table objects auto-fill with corresponding values from the dataset row in the datagrid without making a roundtrip to the server. ...
1
1472
by: Asha | last post by:
greetings, can someone show me how to read a client side value from code behind withouth having to resfresh the page? here is the code i've implemented.... btnSubmission.Attributes.Add("onclick", "return confirm('" & cboVal.SelectedItem.Value & "');") cboval.selecteditem.value will read the value when it was 1st loaded. i want it to dynamiclly read it? without refreshing it of cause. thanks in advance for your help.
1
1156
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 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...
7
2505
by: rn5a | last post by:
The first column of a DataGrid has a CheckBox for all the rows. I want that when users check a CheckBox, the BackColor of that entire row in the DataGrid should change to a different color. To implement this, if I am not mistaken, I HAVE TO post the Form first i.e. set the AutoPostBack property of the CheckBox to True. Without posting the Form, I don't think the BackColor of the checked row can be changed using ASP.NET, isn't it? Of...
1
1584
by: Andrew Wan | last post by:
Is it possible to make some of the DataGrid functionality to client-side? Such as the Edit, Update, Cancel, Delete functionality? Everytime I click on a row's Edit button, I wait 2 seconds before I see the Edit controls (eg. textboxes, drop-down combos, checkboxes). I understand that the DataGrid's Edit, Cancel, Update, Delete functions are server-side because it uses ASP.NET postback handler functions.
4
5048
by: Dan | last post by:
Hi, i'm not sure to understand the difference between refreshing the pagina by clicking on 'refresh' in the browser and a postback. What i think it is: Suppose a page with a form containing a textbox and a dropdowlist: and a button to start something n code-behind: a refresh doesn't send any value back to the server but with a postback, the values are sent? But then, which role does Viewstate play in the postback proces?
0
8205
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8514
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7206
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6126
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4208
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2632
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.