problem editing nested datalist from outer datalist
ok let me explain myself better, i have two tables in my database , doctorate and doctoratefeildofstudies tables, but data is comming into this two tables from one form on a web page called doctorate.aspx, onclick of my submit button it splits the data on the form and inserts them into the two tables using link to sql.
Now, i split the form so that it insert its records into two tables because of the primary and foreign key relationship, secondly, the doctoratefeildofstudies table data comes from a chechboxlist, of which i dnt want to have a comma seperated data in a feild in my doctorate tables, thats why i split the tables into two, also the doctorate table is the primary key table.
now what i want is this, you know for every datalist controls to run into edit mode, its either it responds to itemcommand which you use your if statment to check which button was clicked by checking its commandname or it responds to oneditcommand. now since i have my edit button on the outer datalist control, when i click the outer edit button it only gets the outer datalist into edit mode. but what i want is that as i click the outer edit button, it gets both the outer and inner datalist into edit mode since the data are supposed to appear on the page as one. so what i did was to create an itemcommand for the innerdatalist, wrote the whole edit logic, i also wrote the itemcommand for the outerdatalist, the onclick of the outerdatalist edit button, i the wrote an event handler inside the outerdatalist itemcommand which handles the itemcommand of the innerdatalist, so both of the can go into edit mode together. but not working. pls help. another option is to put an edit button inside the itemtemplate of both datalists controls, but if i do the it will look like data from two seperate tables. But i dont want that, all i want is that as i click the outer edit button, that same button will turn both datalists controls into edit mode at the same time.
|