/// <summary> /// 绑定研报 /// </summary> /// <param name="id"></param> private void BindReports(String id) { object data = ReportDataHelper.GetReportByTreeNode("", "", id, "0", "100", "desc", "", ""); ReportListRoot reportRoot = JsonConvert.DeserializeObject <ReportListRoot>(data.ToString()); List <ReportListNodeBind> bindList = new List <ReportListNodeBind>(); foreach (ReportListNode noticeNode in reportRoot.records) { ReportListNodeBind bind = new ReportListNodeBind(); bind.Copy(noticeNode); bindList.Add(bind); } m_gridAllStockReports.ClearRows(); foreach (ReportListNodeBind report in bindList) { GridRow row = new GridRow(); m_gridAllStockReports.AddRow(row); row.Tag = report; row.AddCell("colN1", new GridStringCell(report.date)); row.AddCell("colN2", new GridStringCell(report.Title)); row.AddCell("colN3", new GridStringCell(report.Url)); row.AddCell("colN4", new GridStringCell(report.id)); row.GetCell("colN1").Style = new GridCellStyle(); row.GetCell("colN1").Style.ForeColor = COLOR.ARGB(255, 255, 80); row.GetCell("colN2").Style = new GridCellStyle(); row.GetCell("colN2").Style.ForeColor = COLOR.ARGB(255, 80, 80); row.GetCell("colN3").Style = new GridCellStyle(); row.GetCell("colN3").Style.ForeColor = COLOR.ARGB(255, 80, 255); } m_gridAllStockReports.Update(); m_gridAllStockReports.Invalidate(); }
/// <summary> /// 单元格双击事件 /// </summary> /// <param name="sender">调用者</param> /// <param name="cell">单元格</param> /// <param name="mp">坐标</param> /// <param name="button">按钮</param> /// <param name="clicks">点击次数</param> /// <param name="delta">滚轮值</param> private void GridCellClick(object sender, GridCell cell, POINT mp, MouseButtonsA button, int clicks, int delta) { if (clicks == 1) { if (cell.Grid == m_tvAllStockReports) { TreeNodeA tn = cell as TreeNodeA; if (tn.m_nodes.Count == 0) { String id = tn.Tag.ToString(); BindReports(id); } } } else if (clicks == 2) { if (cell.Grid == m_gridAllStockReports) { ReportListNodeBind notice = cell.Row.Tag as ReportListNodeBind; String url = notice.Url; Process.Start(url); //String text = StockNewsDataHelper.GetRealTimeInfoByCode(cell.Row.GetCell("colN4").GetString()); //MessageBox.Show(text); } } }