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.
Related
I am working on a project in asp.net. I have a gridview that contains employee's names, designation and department. when i click on the edit button on any row gridview gets hide and the second div is visible that contains different buttons like address, education, trainings etc.Each button shows the specific panel to add or edit the data. But the issue is when i click on any button, the control goes back to the gridview rather than showing the appropriate panel it shows the gridview which was hide. I am using OnEditCommand property of the gridview to hide the gridview and show the other div.How to resolve this issue?
asp.net gridvew
divs to show
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/
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.
}
In my application, I have a list box(list of stores), Add and Remove buttons and another list box (selected stores).
I have Following requirements:
1. On click of Add button, copy selected items from the master stores list to the selected store list and clear the selection from master store list.
2. On Click of Remove button, remove the selected stores from the selected stores list.
I have added my master store list box and selected store list boxes to 2 different update panels and added triggers for each of the update panel. Things are working fine but one thing I have observed that it is taking unusually long to move selected stores from master list to selected list. I have around 5000 entries in the master list of stores.
If I remove the update panel for master store list, things are normal but I am not able to clear the selection. Am I doing something wrong? Is there a way to clear selection of listbox outside the update panel.
It sounds like your using UpdatePanels to move ListItems between 2 ListBox controls. This creates a overhead as each time you trigger the 'add' event it has to postback and render the UpdatePanel again (including the viewstate).
Have you looked into using jQuery to move your list items between your ListBox controls thus all the moving between boxes is handled by the browser. This will speed up the experience for the user?
You should also be able to use jQuery to clear the selection. If you can provide me a little snippet of your markup I can help you get it written up (or shoot me a message).
Brian =)
Using .NET 1.1, I have a DataGrid that contains three columns for each row.
Row one has a label with some text.
Row three will always have two radio buttons and two checkboxes and those are in the HTML side of the page.
Row two will have dynamically generated controls (just textboxes for now) and there can be 1 or more per row. These will be used for user input.
There is a button on the page and when the user clicks the button I need to update the DataGrid’s source (my DataTable) with the new values from the user’s input.
The issue is the DataGrid seems to be losing the dynamically generated controls on PostBack. I can loop through each Item in the DataGrid and I can access the radio buttons and the checkboxes, but the textboxes aren’t there.
Any ideas?
Remember: every time a postback occurs you are working with a new instance of your page class. Dynamic controls added to the page during a previous postback went to the garbage collector as soon as the page for that postback rendered to the browser, along with the rest of that page instance. You need to re-create your dynamic controls on every postback.
you have to regenerate the controls. You should be able to get their values from the http request object