I have master datagrid & master details in 5 panels each belong to diffrent
dbtable. I have a dropdpwn list to switch which panel to be visible..
I also have one navigation bar for add, update, delete and i need to the
button to work with the visible panel but the click event don't fire, here
is my code for the dropdownlist selectedindex change:
private void DropDownList1_S electedIndexCha nged(object sender,
System.EventArg s e)
{
switch(DropDown List1.SelectedI ndex)
{
case 0 :
ResetPanelVisib lity();
Panel1_Personal Info.Visible = true;
this.bt_new.Cli ck += new EventHandler(th is.Panel1_NewRe cord);
this.bt_edit.Cl ick += new EventHandler(th is.Panel1_Updat eRecord);
this.bt_delete. Click += new EventHandler(th is.Panel1_Delet e);
break;
case 1:
ResetPanelVisib lity();
Panel2_Photo.Vi sible = true;
this.bt_new.Cli ck += new EventHandler(th is.Panel2_NewRe cord);
this.bt_edit.Cl ick += new EventHandler(th is.Panel2_Updat eRecord);
this.bt_delete. Click += new EventHandler(th is.Panel2_Delet e);
break;
------------------------------------------------
if i implement a switch case(or if statment) for each button to call methods
it' work.
So How can i fix this problem without use switch case for each button click
event??
regards