protected void query_SortOrderChanged(object sender, Korzh.EasyQuery.SortOrderChangedEventArgs e) { UpdateSql(); }
protected void query_ConditionsChanged(object sender, Korzh.EasyQuery.ConditionsChangeEventArgs e) { UpdateSql(); }
protected void QueryPanel1_ListRequest(object sender, Korzh.EasyQuery.WebControls.ListRequestEventArgs e) { if (e.ListName == "RegionList") { e.ListItems.Add("British Columbia", "BC"); e.ListItems.Add("Colorado", "CO"); e.ListItems.Add("Oregon", "OR"); e.ListItems.Add("Washington", "WA"); } }
protected void QueryPanel1_SqlExecute(object sender, Korzh.EasyQuery.WebControls.SqlExecuteEventArgs e) { CheckConnection(); OleDbDataAdapter resultDA = new OleDbDataAdapter(e.SQL, DbConnection); DataSet tempDS = new DataSet(); resultDA.Fill(tempDS, "Result"); StringWriter strWriter = new StringWriter(); tempDS.WriteXml(strWriter); e.ListItems.LoadFromXml(strWriter.ToString()); }
protected void QueryPanel1_CreateValueElement(object sender, Korzh.EasyQuery.WebControls.CreateValueElementEventArgs e) { // this method demonstrates an ability to change value elelements at run-time // for example in this case we change element from ListRowElement to EditRowElement if list of available values is too long if (e.ConditionRow.Condition is SimpleCondition) { Expression baseExpr = ((SimpleCondition)e.ConditionRow.Condition).BaseExpr; EntityAttr attr = ((DbEntityAttrExpr)baseExpr).Attribute; if (attr.DefaultEditor is SqlListValueEditor) { string sql = ((SqlListValueEditor)attr.DefaultEditor).SQL; if (ResultSetIsTooBig(sql)) { //or put your condition here e.Element = new Korzh.EasyQuery.WebControls.EditXElement(); } } } }