how to reload data based on condition

G

Guest

I have a combo and a datagrid in a page.
Combo box values are loaded on page_Load.
Datagrid is populated based on values selected in the combo (I am using
selectedIndexchange event)

I need to make a default value for the combo(first value available) and
populate the datagrid based on this value on page_Load itself.(Applicable to
many pages in my application)
I tried changing the selectedindex = 1. But the change event is not firing.

How can i achieve this without extra coding(As the system is in production)
Thanks in advance.
 
S

Shiva

Setting SelectedIndex will not fire the event. Rather, call the
DropDownList's SelectedIndexChanged event handler method directly on page
load after setting SelectedIndex.

I have a combo and a datagrid in a page.
Combo box values are loaded on page_Load.
Datagrid is populated based on values selected in the combo (I am using
selectedIndexchange event)

I need to make a default value for the combo(first value available) and
populate the datagrid based on this value on page_Load itself.(Applicable to
many pages in my application)
I tried changing the selectedindex = 1. But the change event is not firing.

How can i achieve this without extra coding(As the system is in production)
Thanks in advance.
 
G

Guest

I think u forgot to set the combo box properties "AutoPostback" to "true"

1 more thing is the default index for combo should be start from "0"
 
G

Guest

Hi suresh,

As a work around for your problem u can explicitly call the selected
indexchanged event handler as soon as you set the selected index to 1

combobox_SelectedIndexChanged(Nothing, Nothing)

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top