Hi James,
I have done a lot of research regarding this issue. Based on my research
and experience, I don't think that we can refresh/rebind the datagrid web
control via the client script.
The reason is that the datagrid web control is a server side control. In
the client side, what we get is a HTML table. Please test the following
simple sample on your side.
----------------------------------------------------------------------------
------------
<%@ Page Language="VB" AutoEventWireup="True" %>
<%@ Import Namespace="System.Data" %>
<html>
<script language="VB" runat="server">
Function CreateDataSource() As ICollection
Dim dt As New DataTable()
Dim dr As DataRow
dt.Columns.Add(New DataColumn("IntegerValue", GetType(Int32)))
dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
dt.Columns.Add(New DataColumn("CurrencyValue", GetType(Double)))
Dim i As Integer
For i = 0 To 8
dr = dt.NewRow()
dr(0) = i
dr(1) = "Item " + i.ToString()
dr(2) = 1.23 *(i + 1)
dt.Rows.Add(dr)
Next i
Dim dv As New DataView(dt)
Return dv
End Function 'CreateDataSource
Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
' Load this data only once.
ItemsGrid.DataSource = CreateDataSource()
ItemsGrid.DataBind()
End If
End Sub 'Page_Load
</script>
<body>
<form runat=server>
<h3>DataGrid Example</h3>
<b>Product List</b>
<asp

ataGrid id="ItemsGrid"
BorderColor="black"
BorderWidth="1"
CellPadding="3"
AutoGenerateColumns="true"
runat="server">
<HeaderStyle BackColor="#00aaaa">
</HeaderStyle>
</asp

ataGrid>
</form>
</body>
</html>
---------------------------------------------------------------------
On the client side, please access the above web page and select
IE->View->Source. We can see the following HTML code.
-------------------------------------------------------
...
<table cellspacing="0" cellpadding="3" rules="all" bordercolor="Black"
border="1" id="ItemsGrid"
style="border-color:Black;border-width:1px;border-style:solid;border-collaps
e:collapse;">
<tr style="background-color:#00AAAA;">
<td>IntegerValue</td><td>StringValue</td><td>CurrencyValue</td>
</tr><tr>
<td>0</td><td>Item 0</td><td>1.23</td>
</tr><tr>
<td>1</td><td>Item 1</td><td>2.46</td>
</tr><tr>
<td>2</td><td>Item 2</td><td>3.69</td>
</tr><tr>
<td>3</td><td>Item 3</td><td>4.92</td>
</tr><tr>
<td>4</td><td>Item 4</td><td>6.15</td>
</tr><tr>
<td>5</td><td>Item 5</td><td>7.38</td>
</tr><tr>
<td>6</td><td>Item 6</td><td>8.61</td>
</tr><tr>
<td>7</td><td>Item 7</td><td>9.84</td>
</tr><tr>
<td>8</td><td>Item 8</td><td>11.07</td>
</tr>
</table>
...
---------------------------------------------------------------
If I have misunderstood your concern, please feel free to let me know.
Best regards,
Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.