问题描述
我使用以下代码。代码已经与datagrid绑定。但是datagrid列标题与以下相同,如Cur_Date,Cur_Time,Itemname等...但我需要Cur_Date作为当前日期Cur_Time作为当前时间,Itemname作为项目名称。我怎么能做到这一点..
我已经检查了css但我没有得到准确的输出,但我需要,如果itemname为Item Name并且设置为列标题。如果操作怎么办这个页面..?
提前谢谢
public List< stockpagebll> SelectAllStock()
{
DataTable dt = sd.SelectAllStock();
List< stockpagebll> stock = new List< stockpagebll>();
foreach(dt.Rows中的DataRow行)
{
StockpageBLL a = new StockpageBLL( );
a.Id = Convert.ToInt32(row [item_id]);
a.Cur_Date = Convert.DateTime(row [cur_date]);
a.Cur_Time = Convert.DateTime(row [cur_time]);
a.Itemname = row [itemname]。ToString();
a.Barcode = row [barcode]。ToString();
a.Location = row [location]。ToString();
a.Sellprize = Convert.ToDecimal(row [sellprize]);
a.Buyprize = Convert.ToDecimal(row [buyprize]);
a .Profit = Convert.ToDecimal(row [profit]);
stock.Add(a);
}
退货;
}
I am using the following the following code. The code already binding with datagrid. But The datagrid column header sames as the following like, Cur_Date,Cur_Time,Itemname etc... but I need Cur_Date as Current Date Cur_Time as Current Time,Itemname as Item Name. How I can achieve this..
I already check css but I didn't get the accurate output,but I need ,if itemname as Item Name and is set to column header. If the operation how to do in this page..?
Thanks in advance
public List<stockpagebll> SelectAllStock()
{
DataTable dt = sd.SelectAllStock();
List<stockpagebll> stock = new List<stockpagebll>();
foreach (DataRow row in dt.Rows)
{
StockpageBLL a = new StockpageBLL();
a.Id = Convert.ToInt32(row["item_id"]);
a.Cur_Date = Convert.DateTime(row["cur_date"]);
a.Cur_Time = Convert.DateTime(row["cur_time"]);
a.Itemname = row["itemname"].ToString();
a.Barcode = row["barcode"].ToString();
a.Location = row["location"].ToString();
a.Sellprize = Convert.ToDecimal(row["sellprize"]);
a.Buyprize = Convert.ToDecimal(row["buyprize"]);
a.Profit = Convert.ToDecimal(row["profit"]);
stock.Add(a);
}
return stock;
}
这篇关于如何使用空格在Capitalize中设置datagrid列标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!