protected void GridView_CustomJSProperties(object sender, ASPxGridViewClientJSPropertiesEventArgs e) { ASPxGridView grid = (ASPxGridView)DropDownEdit.FindControl("GridView"); object[] employeeNames = new object[grid.VisibleRowCount]; object[] keyValues = new object[grid.VisibleRowCount]; for (int i = 0; i < grid.VisibleRowCount; i++) { employeeNames[i] = grid.GetRowValues(i, "EmployerNo") + "/ " + grid.GetRowValues(i, "FundName"); keyValues[i] = grid.GetRowValues(i, "EmployeeIDFundID"); } e.Properties["cpEmployeeNames"] = employeeNames; e.Properties["cpKeyValues"] = keyValues; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ASPxGridView grid = (ASPxGridView)DropDownEdit.FindControl("GridView"); grid.DataBind(); if (Session["SessionFund"] != null) { ProvidentFund fund = ((ProvidentFund)Session["SessionFund"]); DropDownEdit.KeyValue = fund.FundID; DropDownEdit.Text = fund.Code; } else { DropDownEdit.KeyValue = null; DropDownEdit.Text = string.Empty; } } }