private void RefreshMainGrid() { string str = this.task_comboBox.Text; int option = -1; if (str.Equals("Uncompleted", StringComparison.OrdinalIgnoreCase)) { option = 0; } else if (str.Equals("Completed", StringComparison.OrdinalIgnoreCase)) { option = 1; } SQL_condition formCond = this.GetForm_SQLcondition(), filterCond = this.formFilter.FilterCondition; SQL_condition cond = new SQL_condition(formCond, ConditionalOperator.And, filterCond); this.tsk_vc.Get_viewDT_async(option, cond); //Display setting in Grid this.SetGird_sortFilter(this.tsk_vc.ViewData_match_flag); UltraGrid_helper.AutoResize(this.main_ultraGrid); UltraGrid_helper.ClearCurrentFilters(this.main_ultraGrid); this.main_ultraGrid.ActiveRowScrollRegion.Scroll(RowScrollAction.Top); }
/// <summary> /// Refresh data on Grid /// </summary> public void RefreshData(SQL_condition cond) { if (this.StopRefresh_flag) { return; } if ((DateTime.Now - this.lastRefreshAt).TotalSeconds < 5) { Console.WriteLine("---> XBRL_UserControl_func info 0: no refresh within 5 seconds, last at " + this.lastRefreshAt); return; } else { this.lastRefreshAt = DateTime.Now; } Console.WriteLine("---> XBRL_UserControl_func info 1: LastRefreshAt: " + this.lastRefreshAt); //get display data table this.sf_master.Get_viewDT_async(this.shown_processState, cond); //Get action textEditor UltraTextEditor curr_textEditor = null; if (this.approved_radioButton.Checked) { curr_textEditor = this.appr_textEditor; } else if (this.rejected_radioButton.Checked) { curr_textEditor = this.rej_textEditor; } else { curr_textEditor = this.pending_textEditor; } this.main_ultraGrid.DisplayLayout.Bands[0].Columns[UltraGrid_helper.ActionColumnName].EditorComponent = curr_textEditor; //Display setting in Grid this.SetGird_sortFilter(this.sf_master.ViewData_match_flag); UltraGrid_helper.AutoResize(this.main_ultraGrid); UltraGrid_helper.ClearCurrentFilters(this.main_ultraGrid); this.main_ultraGrid.ActiveRowScrollRegion.Scroll(RowScrollAction.Top); }