//ShowControlInfo renders a simple version of the grid control //with the data field names in the columns private string ShowControlInfo(WITGrid wg) { string s = ""; s += "<table cellspacing='0' cellpadding='0'"; if (wg.CssClass != null) s += " class='" + wg.CssClass + "'"; s += " >"; //header ------------------------------------------------------------------ s += "<thead><tr>"; foreach (GridField gf in wg.GridFields) { s += "<th scope='col'"; if (gf.CssClass != null) s += " class='" + gf.CssClass + "'"; s += ">" + gf.HeaderText + "</th>"; } //Special columns if (wg.ShowDeleteColumn) s += "<th>Delete</th>"; if (wg.ShowEditColumn) s += "<th>Edit</th>"; if (wg.ShowOrderColumn) s += "<th>Order</th>"; s += "</thead>"; //Body, 3 rows----------------------------------------------------------------------- s += "<tbody>"; for (int i = 0; i <= 3; i++) { s += "<tr"; if (i == 1) s += " class='gridview-highlight'"; s += ">"; foreach (GridField gf in wg.GridFields) { s += "<td"; if (gf.CssClass != null) s += " class='" + gf.CssClass + "'"; s += ">"; if (gf is CheckBoxField) s += "[" + ((CheckBoxField)gf).DataField + "]"; else if (gf is BoundField) s += "[" + ((BoundField)gf).DataField + "]"; s += "</td>"; } //Special columns, I couldn't find a way to include the images if (wg.ShowDeleteColumn) s += "<td>[delete]</td>"; if (wg.ShowEditColumn) s += "<td>[edit]</td>"; if (wg.ShowOrderColumn) s += "<td>[order]</td>"; s += "</tr>"; } s += "</tbody>"; return s; }
//Constructor public WITGridActionList(WITGrid ctrl) : base(ctrl) { _linkedControl = ctrl; }