on run time
-
if i have table with one col salary ------- 5 9 7 i want to make comboBox for each record in the database the probelm now how can make (onchange) even for each comboBox and save direct to database ... plz help
Palestine
-
if i have table with one col salary ------- 5 9 7 i want to make comboBox for each record in the database the probelm now how can make (onchange) even for each comboBox and save direct to database ... plz help
Palestine
I would do it something like this: Have a foreach statement. Inside that foreach statement create a new combobox. Then add the item to the combobox. You would need to make a method that was generic enough so that you could use it for all of your comboboxes that you make. This method would handle your On Selected Index Change Event. //thrown together, don't trust it to work without checking it over... foreach(datarow dr in table[0].rows) { ComboBox cb = new ComboBox(); //Make sure you give cb a unique name so that you can tell it apart from the other combos. cb.items.add("Pass in your value from the datarow here"); cb.WhateverThatChangeSelectedIndexEventIs += ThatEventITalkedAboutUpAbove(); //I'm sure you can manage to place the combobox on the form in a more exact way... this.controls.add(cb); } Should be something like that.