Onselectedindexchanged is firing - asp.net

In grid row command event I am calling a .ascx page as a popup.
In the popup I have one button, on clicking the button, I'm calling one more popup.
Under the second popup I have four dropdown controls, in the dropdown controls I'm filtering and filling the data one after another.
The problem here is, if I filter the third dropdown, the second dropdown field data is getting reset(Onselectedindexchanged is firing).

You might be reloading/binding the drop downs on post back. You may want to change it to something like this
if(!Page.IsPostback)
{
//load the dropdowns the first time.
}

Related

How to use show second dropdown onchange of first dropdown using meteor.js?

I have two dropdowns in one row. I want to show second row consisting of two dropdowns which will appear onchange of first dropdown using jquery fadeIn() command in meteor.js?
To make second dropdown visible on onchange of first dropdown,
you can do that in your template events properties.
using event properties you can bind functions to events (like jquery) which will get executed when binded event occurs.
Have a look at http://docs.meteor.com/#templates

How to control strange behavior of Ext.NET ComboBox controls?

I have few Ext.NET ComboBox controls on a Web Form. Selecting an item from the first fires the ValueChanged event to populate the second, and so on.
Except Force Selection property, I have not altered other properties of the ComboBox control.
I am experiencing odd behavior of Combo Box controls. As all controls get filled via AJAX request, I find it difficult to set focus on any control. As soon as I bring focus on any control, the cursor disappears after it gets filled.
Secondly, one of the ComboBox is not permitting me to select an item from the list. Even if I try to select an item, it automatically brings back the default item back, which is actually a sixth item in the list.
I double checked the queries and there is no way through which sixth item should get selected.
If I try to open the DropDown list using mouse, it opens for few seconds and collapses automatically.
Is there any way to fix these strange issue? Any other third-party open-source control?
I guess that combos are rebinded in each ajax requests
I suggest to rebind combos in Select direct event handler
Also see the following sample
http://examples1.ext.net/#/Form/ComboBox/Ajax_Linked_Combos/

How to keep focus on control intact while AJAX fills DropDown?

I am using Ext.Net 1.3 library for ASP.NET.
I have five ComboBox controls and each is linked to the other. Selection in the first ComboBox is compulsory. Selecting an item from the first fills the second ComboBox, and so on.
The problem is when I press TAB key to navigate on the controls, the focus is lost after appearing for some time on the next Combo.
This is because, when the first Combo looses focus, it fires the OnSelectedValueChanged event which executes the code to fill the second ComboBox using AJAX.
How to keep the focus intact even while AJAX request is executed?
One option may be to call .Focus() on the triggering ComboBox from within your OnSelectedValueChanged event handler.
This will force the focus to be reset on the ComboBox after the DirectEvent returns.
Hope this helps.

DropDownList Setting Default Value

How should I get a value displayed in the DropDownList when redirected through a cancel buttton. The value in the page where cancel button is there in a TextBox should be caught in the DropDownList.
This DropDownList has SelectedIndexChanged event also fired for which on selection of a country in the list we get a ListView displayed in the same page. In that ListView we have an add button which will redirect us to another page called addcountry in which we have few controls. In those controls one TextBox I am getting value through QueryString in an enabled False state. Now again I need that value displayed in the DropDownList when I click cancel button.
How can I solve this problem?
Using $_POST and $_GET Variables you should be able to retreive almost any value from a form and put it in the right place on a new page, this right place can be one of your drop down list element...
To make absolutly sure your Cancel Button will send the good value to the right page put it in an independant form that has your new page (where you have yout dropdown list) as its action, and in this seperate form put an hidden field that holds the specific value you wanna see in this dd list ...
Hope I am clear but starting with your very "fuzzy" and blur question It is hard to help you.

Persisting Checkbox State Across Postbacks

I have a web form that binds a DataGrid to a, normally, different data source on each postback. I have a static CheckBox column that is always present to the left of the autogenerated columns. I achieve a TabControl effect with a horizontal Menu control above the grid, with each menu item being a tab that contains a different grid.
Now I would like to persist the state of these checkboxes for a particular 'tab', when another tab is selected. I would welcome any imaginative solution for doing this without using session variables.
I think the best bet for this is to have a different gridview for each of your "tabs". Use the MultiView control with a View control for each tab, and a gridview in each View. In the click event of your menu change to the correct view. Only bind each gridview once, and then your checkboxes will persist.

Resources