Hi,
Now i need my project for adding cusomt values in dropdown. meantime. I had dropdown named like biodata, its consists of age, gender,sex, religion. Now i need add item name custom in Dropdown for users chooses its from dropdown another pop-up will appear, and it had some items in form and they filled it up thier details respectively. and click ok then The selected values are returned to grid.
Anyone could known pls help me.
Advance in Thanks
H.AL-MUBARAK
Loading
Madhu KPosted Dec 10, 2010, 5:44 AM
public void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(DropDownList1.SelectedItem.Text=="Custom")
{
//your code for pop up.
}
}
CrishPosted Dec 10, 2010, 5:42 AM
You can refer following code for add custom values in dropdown.It will help you.
AL MUBARAKPosted Dec 10, 2010, 5:26 AM
Thanks, for quick reply. and i had some doubt about i already get from the data's in DB are stored in dropdown_selectedIndexchanged function name. Then how to i import In dropdown selected index changed event check if the selected item is custom then open the popup and the rest of my code.
Please help to solve this issue with sample code.
Thanks,
Madhu KPosted Dec 10, 2010, 1:45 AM
DataRow dr = dt.NewRow();
dr["column_name"] = "Custom";
dt.Rows.Add(dr);
then bind the datatable to dropdown list.
In dropdown selected index changed event check if the selected item is custom then open the popup and the rest of your code.
Hope it helps
AL MUBARAKPosted Dec 10, 2010, 1:14 AM
Hi mamta,
What i mean like, i have a drop down named Templates k. the template drop down had some items has to be filled from database. now i need to add a manual item (i.e) Name - "Custom". still the name custom should be shown in last of dropdown's item. when the user clicks it. a pop-up will appear. The pop-up had some items with checkoxes . when the user wants to check items from pop-up for thier needs. then click ok button has already given in pop-up. The checked values return to appropirate grid.
Are u understand now. k Fine., Could you please help to acheive this? can you give me a sample code?
Advance in Thanks
Mamta MPosted Dec 10, 2010, 12:18 AM
"Now i need add item name custom in Dropdown for users chooses its from dropdown another pop-up will appear, and it had some items in form and they filled it up thier details respectively."