By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,084 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

how to reload data based on condition

P: n/a
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.
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


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

"Suresh" <Su****@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
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.
Nov 18 '05 #2

P: n/a
Lok
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"

"Suresh" wrote:
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.

Nov 18 '05 #3

P: n/a
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
"Suresh" wrote:
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.


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.