/*protected void gvSecurityHolding_Sorting(object sender, GridViewSortEventArgs e) * { * // Since a GridView cannot be sorted directly, it is first loaded into a DataTable using the helper method 'unloadGridView'. * // Create a DataTable from the GridView. * DataTable dtSecurityHolding = myHKeInvestCode.unloadGridView(gvSecurityHolding); * // Set the sort expression in ViewState for correct toggling of sort direction, * // Sort the DataTable and bind it to the GridView. * string sortExpression = e.SortExpression.ToLower(); * ViewState["SortExpression"] = sortExpression; * dtSecurityHolding.DefaultView.Sort = sortExpression + " " + myHKeInvestCode.getSortDirection(ViewState, e.SortExpression); * dtSecurityHolding.AcceptChanges(); * // Bind the DataTable to the GridView. * gvSecurityHolding.DataSource = dtSecurityHolding.DefaultView; * gvSecurityHolding.DataBind(); * }*/ protected void gvBond_Sorting(object sender, GridViewSortEventArgs e) { DataTable dtBond = myHKeInvestCode.unloadGridView(gvBond); string sortExpression = e.SortExpression.ToLower(); ViewState["SortExpression"] = sortExpression; dtBond.DefaultView.Sort = e.SortExpression + " " + myHKeInvestCode.getSortDirection(ViewState, e.SortExpression); //dtBond.DefaultView.Sort = "name" + " " + "ASC"; //dtBond.AcceptChanges(); gvBond.DataSource = dtBond.DefaultView; gvBond.DataBind(); }
protected void OrderStatus_Sorting(object sender, GridViewSortEventArgs e) { // Since a GridView cannot be sorted directly, it is first loaded into a DataTable using the helper method 'unloadGridView'. // Create a DataTable from the GridView. DataTable dt_order_status = myHKeInvestCode.unloadGridView(OrderStatus); // Set the sort expression in ViewState for correct toggling of sort direction, // Sort the DataTable and bind it to the GridView. ViewState["SortExpression"] = e.SortExpression; dt_order_status.DefaultView.Sort = e.SortExpression + " " + myHKeInvestCode.getSortDirection(ViewState, e.SortExpression); dt_order_status.AcceptChanges(); // Bind the DataTable to the GridView. OrderStatus.DataSource = dt_order_status.DefaultView; OrderStatus.DataBind(); }
protected void gvProfitLossTracking_Sorting1(object sender, GridViewSortEventArgs e) { DataTable dtProfitLossTracking = myHKeInvestCode.unloadGridView(gvProfitLossTracking); string sortExpression = e.SortExpression.ToLower(); ViewState["SortExpression"] = sortExpression; dtProfitLossTracking.DefaultView.Sort = sortExpression + " " + myHKeInvestCode.getSortDirection(ViewState, e.SortExpression); dtProfitLossTracking.AcceptChanges(); gvProfitLossTracking.DataSource = dtProfitLossTracking.DefaultView; gvProfitLossTracking.DataBind(); }
protected void gvSecurityHolding_Sorting(object sender, GridViewSortEventArgs e) { // Since a GridView cannot be sorted directly, it is first loaded into a DataTable using the helper method 'unloadGridView'. // Create a DataTable from the GridView. DataTable dtSecurityHolding = myHKeInvestCode.unloadGridView(gvSecurityHolding); // Set the sort expression in ViewState for correct toggling of sort direction, // Sort the DataTable and bind it to the GridView. string sortExpression = e.SortExpression.ToLower(); ViewState["SortExpression"] = sortExpression; dtSecurityHolding.DefaultView.Sort = sortExpression + " " + myHKeInvestCode.getSortDirection(ViewState, e.SortExpression); dtSecurityHolding.AcceptChanges(); // Bind the DataTable to the GridView. gvSecurityHolding.DataSource = dtSecurityHolding.DefaultView; gvSecurityHolding.DataBind(); }