Hello,
I have a grid, which is dynamically build, in the first index, should there be a checkbox, for a multiselect.
When i go to the next page in the grid, i have lost my 'checks'.
Now i want to write each one in the page i am working with in a session, however how can i read the value of the row?
under here is my code:
When you need more, let me know.
Thanks for help in advance.
Peter
I have a grid, which is dynamically build, in the first index, should there be a checkbox, for a multiselect.
When i go to the next page in the grid, i have lost my 'checks'.
Now i want to write each one in the page i am working with in a session, however how can i read the value of the row?
under here is my code:
| 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. |
| } |
| } |
When you need more, let me know.
Thanks for help in advance.
Peter