Note that there are some explanatory texts on larger screens.

plurals
  1. POradGrid control displays blank grid after date parameter is changed
    primarykey
    data
    text
    <p>I searched SO, google &amp; Telerik forums, but could not find a solution. </p> <p>I have an existing app (written by a previous developer) that is calling a stored procedure that populates a RadGrid control. It populates fine the first time around. </p> <p>However, when I change the date parameter, click "search" button, I get a blank RadGrid control. When I click search the second time, the grid is populated. When I walk through the code, I get an error message </p> <blockquote> <p>Column 'ID' does not belong to table Table.</p> </blockquote> <p>How can I resolve the issue of having to click search twice to display data ? </p> <p>My code behind is: </p> <pre><code>protected void btnSubmit_OnClick(object sender, EventArgs e) { try { ViewState["newset"] = null; CreateDatasource(); this.RadGrid1.DataBind(); this.RadGrid1.CurrentPageIndex = 0; ViewState["newset"] = "new"; string idex = this.hdnindex.Value; if (idex != string.Empty) this.RadGrid1.MasterTableView.Items[int.Parse(idex)].Selected = true; } catch (Exception ex) { this.lblMessage.Text = ex.Message; } } protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) { try { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; HyperLink hLink = (HyperLink)item["ViewHyperLink"].Controls[0]; if (hLink != null) hLink.Attributes.Add("onclick", "selectMe('" + item.ItemIndex + "');"); } } catch (Exception ex) { this.lblMessage.Text = ex.Message; } } </code></pre> <p>In the code behind above, when this.RadGrid1.DataBind() is called, the code steps into <code>RadGrid1_ItemCreated</code> loops through the if statement a few times, them goes into the if statement, comes out of the function, and then the catch statement of btnSubmit is called, which displays the error message "Column ID does not belong to table Table". </p> <p>Any ideas on how to resolve this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload