or
| protected void gridOverzichtLijst_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| try |
| { |
| IEntityCollection coll = GetSearchColl(); |
| gridOverzichtLijst.MasterTableView.DataKeyNames = new string[] { _idFieldName }; |
| //first clean the colums. |
| gridOverzichtLijst.Columns.Clear(); |
| GridTemplateColumn kolom = new GridTemplateColumn(); |
| kolom.UniqueName = "CheckBoxTemplateColumn"; |
| kolom.HeaderStyle.Width = 30; |
| kolom.ItemTemplate = new MyTemplate("cbRapport"); |
| gridOverzichtLijst.Columns.Add(kolom); |
| GridSortExpression expression = new GridSortExpression(); |
| expression.FieldName = SortField; |
| expression.SortOrder = GridSortOrder.Ascending; |
| if (!SortAscending) |
| expression.SortOrder = GridSortOrder.Descending; |
| gridOverzichtLijst.DataSource = coll; |
| gridOverzichtLijst.MasterTableView.SortExpressions.AddSortExpression(expression); |
| } |
| catch (Exception ex) |
| { |
| ErrorHandler.GetErrorHandler().WriteCriticalError("wucMasterLijst", "gridOverzichtLijst_NeedDataSource", ex.Message); |
| } |
| } |
| public class MyTemplate : ITemplate |
| { |
| protected CheckBox CheckBox1; |
| private string colname; |
| private System.Web.UI.Control cont; |
| public MyTemplate(string cName) |
| { |
| colname = cName; |
| } |
| public void InstantiateIn(System.Web.UI.Control container) |
| { |
| CheckBox1 = new CheckBox(); |
| CheckBox1.ID = "CheckBox1"; |
| CheckBox1.Enabled = true; |
| CheckBox1.AutoPostBack = true; |
| CheckBox1.CheckedChanged += new EventHandler(CheckBox1_CheckedChanged); |
| container.Controls.Add(CheckBox1); |
| } |
| void CheckBox1_CheckedChanged(object sender, EventArgs e) |
| { |
| //here should be, at least i think, the code to put the value in a list to remember. |
| } |
| } |