【发布时间】:2014-06-26 17:39:13
【问题描述】:
我会详细说明。我正在尝试获取付款失败的描述,我想将鼠标悬停在图像或状态上以查看付款失败的原因描述:
这是获取绑定到 Gridview 的数据的 c#
DataTable BillingDT = new DataTable();
BillingDT = Q.GetBillHistory(SessionVars.Current.varContractID);
BillingDT.Columns.Add("PayNum", System.Type.GetType("System.String"));
BillingDT.Columns.Add("DateStr", System.Type.GetType("System.String"));
BillingDT.Columns.Add("AmountStr", System.Type.GetType("System.String"));
BillingDT.Columns.Add("BalanceStr", System.Type.GetType("System.String"));
BillingDT.Columns.Add("description", System.Type.GetType("System.String"));
string DownPayment = DT.Select("Name = 'DownPayment'")[0][1].ToString();
for (int row = 0; row < BillingDT.Rows.Count; row++)
{
BillingDT.Rows[row]["PayNum"] = BillingDT.Rows[row]["Payment"].ToString();
BillingDT.Rows[row]["DateStr"] = Convert.ToDateTime(BillingDT.Rows[row]["paydate"]).ToShortDateString();
if (BillingDT.Rows[row]["payment"].ToString() == "0") {
BillingDT.Rows[row]["PayNum"] = DownPayment;
}
if (BillingDT.Rows[row]["status"].ToString().Length < 1) {
BillingDT.Rows[row]["status"] = "";
}
if (BillingDT.Rows[row]["descript"].ToString().Length < 1) {
BillingDT.Rows[row]["description"] = "";
}
if (BillingDT.Rows[row]["amount"].ToString().Length > 0) {
BillingDT.Rows[row]["AmountStr"] = FV.MoneyString(Convert.ToDecimal(BillingDT.Rows[row]["amount"]));
}
BillingDT.Rows[row]["BalanceStr"] = (BillingDT.Rows[row]["balance"].ToString().Length > 0) ? FV.MoneyString(Convert.ToDecimal(BillingDT.Rows[row]["balance"])) : "";
}
BillingHistoryGV.DataSource = BillingDT;
BillingHistoryGV.DataBind();
这是我想将描述绑定到工具提示的 ASP:Image:
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="StatusIconImg" runat="server" ImageUrl='<%# GetImage((string)Eval("Status")) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="20px" />
</asp:TemplateField>
【问题讨论】: