public DataTable ColumnInGrid(DataTable dt, YYControls.SmartGridView sg) { for (int i = (dt.Columns.Count - 1); i >= 0; i--) { bool b = false; for (int j = 0; j < sg.Columns.Count; j++) { if (dt.Columns[i].ColumnName == sg.Columns[j].SortExpression) { dt.Columns[i].ColumnName = sg.Columns[j].HeaderText; b = true; } } if (b == false) { dt.Columns.Remove(dt.Columns[i]); } } return(dt); }
/// <summary> /// CheckBox连选(此函数勿动) /// </summary> /// <param name="smartgridview"></param> /// <param name="ckbname"></param> public void CheckBoxSelectDefine(YYControls.SmartGridView smartgridview, string ckbname) { int startindex = -1; int endindex = -1; for (int i = 0; i < smartgridview.Rows.Count; i++) { System.Web.UI.WebControls.CheckBox cbx = (System.Web.UI.WebControls.CheckBox)smartgridview.Rows[i].FindControl(ckbname); if (cbx.Checked) { startindex = i; break; } } for (int j = smartgridview.Rows.Count - 1; j > -1; j--) { System.Web.UI.WebControls.CheckBox cbx = (System.Web.UI.WebControls.CheckBox)smartgridview.Rows[j].FindControl(ckbname); if (cbx.Checked) { endindex = j; break; } } if (startindex < 0 || endindex < 0 || startindex == endindex) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('需要勾选2条记录!!!');", true); } else { for (int k = startindex; k <= endindex; k++) { System.Web.UI.WebControls.CheckBox cbx = (System.Web.UI.WebControls.CheckBox)smartgridview.Rows[k].FindControl(ckbname); cbx.Checked = true; } } }
internal static void Paging(DataTable dt, YYControls.SmartGridView GridView1, PagerQueryParam pager_pro, Panel NoDataPanel) { throw new NotImplementedException(); }