前台用Table控件显示重复数据的类
2005-04-27 19:49
561 查看
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using dataManagerForEC;
using System.Data;
using System.Data.SqlClient;
namespace ec
{
/// <summary>
/// tableDraw 的摘要说明。
/// </summary>
public class tableDraw
{
public tableDraw()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
static public void drawDoubleCol(dataManager dm,DataSet ds,Table table,int rowNum,string imgPath,string tableName,string colLink,string colName,string colOrder,string linkWebPage)
{
table.BorderWidth=0;
table.CellPadding=0;
table.CellSpacing=0;
string sqlSelect="select top "+rowNum.ToString()+" "+colLink+","+colName+" from "+tableName+" order by "+colOrder+" desc";
dm.SelectData(ds,sqlSelect,tableName);
for(int i=0;i<ds.Tables[tableName].Rows.Count;i++)
{
TableRow tRow=new TableRow();
table.Rows.Add(tRow);
TableCell tCell=new TableCell();
tCell.Width=20;
tCell.HorizontalAlign=HorizontalAlign.Center;
tCell.Text="<img src='"+imgPath+"'>";
tRow.Cells.Add(tCell);
TableCell tCell2=new TableCell();
//tCell2.Width=int.Parse(table.Width.ToString())-int.Parse(tCell.Width.ToString());
tCell2.Text="<a href="+linkWebPage+"?id="+ds.Tables[tableName].Rows[i][colLink].ToString()+" target='_blank'>"+ds.Tables[tableName].Rows[i][colName].ToString()+"</a>";
tRow.Cells.Add(tCell2);
}
ds.Tables[tableName].Clear();
}
}
}
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using dataManagerForEC;
using System.Data;
using System.Data.SqlClient;
namespace ec
{
/// <summary>
/// tableDraw 的摘要说明。
/// </summary>
public class tableDraw
{
public tableDraw()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
static public void drawDoubleCol(dataManager dm,DataSet ds,Table table,int rowNum,string imgPath,string tableName,string colLink,string colName,string colOrder,string linkWebPage)
{
table.BorderWidth=0;
table.CellPadding=0;
table.CellSpacing=0;
string sqlSelect="select top "+rowNum.ToString()+" "+colLink+","+colName+" from "+tableName+" order by "+colOrder+" desc";
dm.SelectData(ds,sqlSelect,tableName);
for(int i=0;i<ds.Tables[tableName].Rows.Count;i++)
{
TableRow tRow=new TableRow();
table.Rows.Add(tRow);
TableCell tCell=new TableCell();
tCell.Width=20;
tCell.HorizontalAlign=HorizontalAlign.Center;
tCell.Text="<img src='"+imgPath+"'>";
tRow.Cells.Add(tCell);
TableCell tCell2=new TableCell();
//tCell2.Width=int.Parse(table.Width.ToString())-int.Parse(tCell.Width.ToString());
tCell2.Text="<a href="+linkWebPage+"?id="+ds.Tables[tableName].Rows[i][colLink].ToString()+" target='_blank'>"+ds.Tables[tableName].Rows[i][colName].ToString()+"</a>";
tRow.Cells.Add(tCell2);
}
ds.Tables[tableName].Clear();
}
}
}
相关文章推荐
- C#中“类似GridView等控件”的前台显示与后台数据变化之间的关系
- 关于Web项目里的给表单验证控件添加结束时间不得小于开始时间的验证方法,日期转换和前台显示格式之间,还有JSON取日期数据格式转换成标准日期格式的问题
- [转]Android ListView最佳处理方式,ListView拖动防重复数据显示,单击响应子控件
- ext grid 前台grid加载数据碰到数据重复只显示一条
- 数据绑定控件Repeater/GridView/DataList在前台显示正确的文本格式收藏
- IOS第七天(4:UiTableView 数据的显示优化重复实例和tableFooterView和tableHeaderView)
- 关于table控件直接显示数据
- 数据绑定控件Repeater/GridView/DataList在前台显示正确的文本格式
- 关于table控件直接显示数据
- 【struts2】用struts2传数据,前台左侧导航css+js,table显示隔行变色,css样式。
- bootstrap-table当查询后再去点击分页时,后台返回的数据是正确的,前台也显示正确了,但是当我点击分页时,列表会刷新为最初的数据,而不再是本次查询得到的数据
- 对于分页时,若数据库的数据不断更新,不让前台显示脏数据(同一条数据重复显示)的处理方式
- 《项目经验》--后台一般处理程序向前台JS文件传递JSON,JS解析JSON,将数据显示在界面--显示在DropDownList 或 显示在动态创建的table中
- [置顶] ajax请求得到后台数据,前台页面,使用table模板然后clone,显示表格,,不用append拼接 “字符串和HTML表格标签”
- Android ListView最佳处理方式,ListView拖动防重复数据显示,单击响应子控件
- 《项目经验》--后台一般处理程序向前台JS文件传递JSON,JS解析JSON,将数据显示在界面--显示在DropDownList 或 显示在动态创建的table中
- 只显示重复数据,或不显示重复数据
- IOS开发中tableView显示列表内容数据(storyboard版)
- Android ListView最佳处理方式,ListView拖动防重复数据显示,单击响应子控件
- 对绑定到repeater控件的数据消除重复行