protected void Grid1_RowDataBound(object sender, GridRowEventArgs e) { Infobasis.Data.DataEntity.Client client = e.DataItem as Infobasis.Data.DataEntity.Client; DateTime?lastTraceDate = Convert.ToDateTime(client.LastTraceDate); FineUIPro.BoundField bfTraceNum = Grid1.FindColumn("bfTraceNum") as FineUIPro.BoundField; int columnIndexTraceNum = bfTraceNum.ColumnIndex; int lastTraceDays = Infobasis.Web.Util.DateHelper.GetClientTraceDays(lastTraceDate, DateTime.Now); e.Values[columnIndexTraceNum] = String.Format("<span class=\"{0}\" data-qtip=\"{4}\">{1}-{2}-{3}</span>", lastTraceDays >= 10 || lastTraceDays == 0 ? "traceWarning" : "traceNormal", Change.ToInt(lastTraceDays), 0, 0, string.Format("最后跟进已过:{0} 天", lastTraceDays)); FineUIPro.WindowField wfdisableClientField = Grid1.FindColumn("disableClientField") as FineUIPro.WindowField; if (client.Disabled.HasValue && client.Disabled.Value) { int columnIndexDisabled = wfdisableClientField.ColumnIndex; e.Values[columnIndexDisabled] = "<a class=\"ui-state-disabled\" disabled=\"disabled\" data-qtip=\"废单\">已废单</a>"; FineUIPro.WindowField changeToNextField = Grid1.FindColumn("changeToNextField") as FineUIPro.WindowField; int columnIndexToNext = changeToNextField.ColumnIndex; e.Values[columnIndexToNext] = ""; } }
protected void CheckPowerFailWithWindowField(FineUIPro.Grid grid, string columnID) { FineUIPro.WindowField btn = grid.FindColumn(columnID) as FineUIPro.WindowField; btn.Hidden = true; btn.Enabled = false; btn.ToolTip = CHECK_POWER_FAIL_ACTION_MESSAGE; }
protected void Page_Init(object sender, EventArgs e) { DateTime dtime = DateTime.Now; int a = Convert.ToInt32(dtime.ToString("yyyy")); int b = a - 2015; int c = 0; int d = a + 1; FineUIPro.BoundField bf; for (int i = 1; i <= b + 1; i++) { c = 2014 + i; bf = new FineUIPro.BoundField(); bf.DataFormatString = "{0}"; bf.SortField = "y" + c.ToString(); bf.DataField = "y" + c.ToString(); bf.HeaderText = c.ToString() + "年消耗"; Grid1.Columns.Add(bf); bf = new FineUIPro.BoundField(); bf.DataFormatString = "{0}"; bf.SortField = "price" + c.ToString(); bf.DataField = "price" + c.ToString(); bf.HeaderText = c.ToString() + "总价"; Grid1.Columns.Add(bf); } bf = new FineUIPro.BoundField(); bf.DataFormatString = "{0}"; bf.SortField = "新数量"; bf.DataField = "新数量"; bf.Width = 200; bf.HeaderText = d.ToString() + "年预计采购数量"; Grid1.Columns.Add(bf); bf = new FineUIPro.BoundField(); bf.DataFormatString = "{0}"; bf.ColumnID = "新总价";; bf.SortField = "新总价"; bf.DataField = "新总价"; bf.Width = 250; bf.HeaderText = "预计费用"; Grid1.Columns.Add(bf); FineUIPro.WindowField wf = new FineUIPro.WindowField(); wf.ColumnID = "ViewDeviceContent"; wf.TextAlign = FineUIPro.TextAlign.Center; wf.Icon = FineUIPro.Icon.Pencil; wf.ToolTip = "预览"; wf.HeaderText = "预览"; wf.WindowID = "Window1"; wf.Title = "预览设备类型"; wf.DataIFrameUrlFields = "物料号"; wf.DataIFrameUrlFormatString = "../备件统计分析/Spare_Part_DeviceContent.aspx?id={0}"; Grid1.Columns.Add(wf); }