Click here to Skip to main content
16,021,169 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I write this in page load
cmbBatchno.Load += new EventHandler(cmbBatchno_Load(object sender,EventArgs e))

and
this is the event i write but its not working.. pls help me....


C#
void cmbBatchno_Load(object sender, EventArgs e)
   {
       if (ViewState["BatchNo"] != null)
       {
           DataTable dtBatchNoDtls = (DataTable)ViewState["BatchNo"];
           for (int i = 0; i < dtBatchNoDtls.Rows.Count; i++)
           {
               if (cmbBatchno.Text == dtBatchNoDtls.Rows[i]["BatchNo"].ToString())
               {
                   txtExpdate.Enabled = false;
                   txtMRP.Enabled = false;
                   break;
               }
               else
               {
                   txtExpdate.Enabled = true;
                   txtMRP.Enabled = true;
                   txtExpdate.Text = string.Empty;
                   txtMRP.Text = "";
                   txtRate.Text = "";
               }
           }

       }


   }
Posted
Comments
[no name] 19-Oct-13 8:29am    
What is the problem you are facing..what you are trying to achieve..
Use Improve question and include these details so that the question will be more clear for everyone.
MANI 14 19-Oct-13 8:32am    
i want to get batchno in combo box text. If that batchno is not match with the viewstate details then txtexpdate,txtmrp make it enable.
MANI 14 19-Oct-13 8:34am    
when combo box text is changed then check the text and do that actions in cmbatchno_load event
pls help me
JoCodes 19-Oct-13 12:39pm    
Try to Change the event binding cmbBatchno.Load += new EventHandler(cmbBatchno_Load);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900