GridView控件问题,解决这个问题包括我开的两个100分的贴(200分)还有我剩下的200多分,一共400多分全部给你,说话算数.
dyweb 2006-11-28 05:18:23 我的代码:
all.xml文件:
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<Titles>
<id>112107</id>
<ts>0.65</ts>
<ss>0.74</ss>
<es>1.25</es>
</Titles>
</NewDataSet>
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim ds As New DataSet
ds.ReadXml("D:\all.xml")
GridView1.DataSource = ds.Tables(0).DefaultView
GridView1.DataBind()
End Sub
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ToXML.aspx.vb" Inherits="ToXML" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="15000" />
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
显示在Gridview控件上如下:
| id | ts | ss | es |
|112107|0.65|0.74|1.25|
如果现在all.xml文件 <ts>0.65</ts> 变成了 <ts>0.75</ts>
那么Gridview中|0.65|就会自动变成|0.75|.
如果我想这个网格背景色就变成绿色。就是数据变化的地方变色,让别人能看到是这里变化了数据.请问怎么实现?
这个问题我郁闷了好多天,解决了问题包括我开的两个100分的贴(200分)还有我剩下的200多分,一共400多分全部给你,说话算数.