Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I load the Same ASP Grid View with different conditions?
    text
    copied!<p>I have a DDL and a ASP .net Grid view in my aspx page. I have two methods getALLProgram and getProgramBy name, both are working fine. My problem is: when the page is loaded for the first time, I want to call the getAllprogram method, after that if a User selects a program from DDL I want my getprogramByname method to be called. </p> <p>How here is my code:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindProgramDDL(); BindGrid(); } //BindProgramDDL(); } protected void BindGrid() { string strProgramCode = DDLProgram.SelectedIndex.ToString(); List&lt;FormGridEntity&gt; gridEntities = new List&lt;FormGridEntity&gt;(); GridForResult.DataSource = gridEntities; GridForResult.DataBind(); //throw new NotImplementedException(); } protected void BindProgramDDL() { List&lt;CcProgramEntity&gt; programEntities = FormSaleSubmit_BAO.GetAllPrograms(); DDLProgram.DataSource = programEntities; DDLProgram.DataTextField = "Shortname"; DDLProgram.DataValueField = "Id"; DDLProgram.DataBind(); string programCode = programEntities[DDLProgram.SelectedIndex].Code; } protected void OnDDLProgramChanged(object sender, EventArgs e) { List&lt;CcProgramEntity&gt; programEntities = FormSaleSubmit_BAO.GetAllPrograms(); string programCode = programEntities[DDLProgram.SelectedIndex].Code; } </code></pre> <p>The Code is incomplete. i am still working on it. But I not getting the logic How will I make this happen that I have told you here. I hope I made my question clearly, if it confusing, please let me know what else I should provide here.</p>
 

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