/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void JQGrid2_DataRequesting(object sender, JQGridDataRequestEventArgs e) { DataSet ds = new DataSet(); try { AppSettingsReader asr = new AppSettingsReader(); string dbconn = (string)asr.GetValue("dbconn", typeof(string)); using (SqlConnection conn = new SqlConnection(dbconn)) { conn.Open(); SqlCommand sqlcomm = new SqlCommand("select * from v_abnormal_NOXSO2_Relevant2 where id2 = '" + e.ParentRowKey.ToString() + "'", conn); SqlDataAdapter sqladapter = new SqlDataAdapter(sqlcomm); sqladapter.Fill(ds); conn.Close(); } } catch (Exception) { } Jqgrid2.DataSource = ds.Tables[0]; Jqgrid2.DataBind(); // }
protected void JqgridHomeTeam_DataRequesting(object sender, JQGridDataRequestEventArgs e) { var teamHomeMatchList = ThaitaeDataDataContext.Create().TeamMatches.Where(item => item.MatchId == Convert.ToInt32(e.ParentRowKey) && item.TeamHome == 1).ToList(); JqgridHomeTeam.DataSource = teamHomeMatchList; JqgridHomeTeam.DataBind(); }
protected void JqgridHomePlayer_DataRequesting(object sender, JQGridDataRequestEventArgs e) { List<PlayerMatch> playerTeamList; using (var dc = ThaitaeDataDataContext.Create()) { int teamMatchid = Convert.ToInt32(e.ParentRowKey); var team = dc.TeamMatches.Single(item => item.TeamMatchId == teamMatchid); playerTeamList = ThaitaeDataDataContext.Create().PlayerMatches.Where( item => item.TeamId == team.TeamId && item.MatchId == team.MatchId && item.SeasonId == team.SeasonId).ToList(); } JqgridHomePlayer.DataSource = playerTeamList; JqgridHomePlayer.DataBind(); }
private void ProcessCallBack() { int num = Convert.ToInt32(this.QueryString["page"]); int pageSize = Convert.ToInt32(this.QueryString["rows"]); string sortExpression = this.QueryString["sidx"]; string sortDirection = this.QueryString["sord"]; string search = this.QueryString["_search"]; string parentRowKey = this.QueryString["parentRowID"]; if (this._filteredGridState != null && this.ExportSettings.ExportDataRange != ExportDataRange.FilteredAndPaged) { num = 1; pageSize = 1000000; } this.PagerSettings.CurrentPage = num; this.PagerSettings.PageSize = pageSize; JQGrid.JQGridDataRequestEventHandler jQGridDataRequestEventHandler = (JQGrid.JQGridDataRequestEventHandler)base.Events[JQGrid.EventDataRequesting]; if (jQGridDataRequestEventHandler != null) { string whereClause = this.GetWhereClause(search, false); JQGridDataRequestEventArgs jQGridDataRequestEventArgs = new JQGridDataRequestEventArgs(sortExpression, sortDirection, num, whereClause, parentRowKey); this.OnDataRequesting(jQGridDataRequestEventArgs); if (jQGridDataRequestEventArgs.TotalRows > 0) { this._totalRows = jQGridDataRequestEventArgs.TotalRows; } } if (this.IsGridRequest()) { this._selectArguments = this.CreateDataSourceSelectArguments(); this.GetData().Select(this._selectArguments, new DataSourceViewSelectCallback(this.OnDataSourceViewSelectCallback)); } }
protected internal virtual void OnDataRequesting(JQGridDataRequestEventArgs e) { JQGrid.JQGridDataRequestEventHandler jQGridDataRequestEventHandler = (JQGrid.JQGridDataRequestEventHandler)base.Events[JQGrid.EventDataRequesting]; if (jQGridDataRequestEventHandler != null) { jQGridDataRequestEventHandler(this, e); } }