Timer causes dropdownlists to disappear permanently after a modal popup - c#

On a fairly complex page, we're getting some unusual behavior with dropdownlists in IE6. To layout the basic structure, there are 2 update panels on the page each with a GridView presenting a master-details layout. In addition to the grid, each panel houses some DropDownLists for filtering the data in the respective GridView.
Now what's happening is that a button on the bottom grid will cause a modal popup form to display, where some details about the row item can be modified. As per the ASP.NET AJAX JavaScript, the DropDowns disable during the postback, and re-enable after it closes.
The bottom grid also has a timer attached to it that periodically updates it to keep the view of the data fresh. When this timer ticks after the modal popup is closed, the drop down lists mysteriously vanish, except for the ones in that update panel which apparently get rendered again.
Oddly enough, if the timer ticks while the popup is up, the drop downs enable early and show through the modal (oh IE6...) but don't vanish later on.

Been a while since I posted this, but the problem occasionally resurfaces and I think I finally found an answer to it.
The AJAX Toolkit's modal popup javascript disables all DropDownLists on the page because they show through to the highest Z-level in IE6. But if something causes a postback while the modal is showing (like a badly managed timer) then the invisible state gets recorded into the viewstate for the DDLs.
One easy way around it is to just put the offending DDLs in an update panel, so they properly get refreshed on updates and don't get stuck. The more complex way is to ensure nothing causes extraneous postbacks while the modal is showing. The best way would probably be to ditch Webforms and all the baggage with it, but that's pretty much not going to happen.

Related

Handling Detail updates in Master-Detail view in Winform C#

I have an application which has a Mainform that has 2 panels using a splitter. The top panel is a form that has the binding navigator, dataset, bindingsource, tableadapters..
The bottom panel is a form as well. It's just a datagridview basically. I pass the bindingsource from the top form, into the bottom form when the Mainform loads.
The bottom form takes the bindingsource, and uses a relationship (between two tables) for it's own datasource member.
Viewing the data works great.
When I update data in the master, i capture it when the user is navigating off the record. I use bindingsource.EndEdit(), DataSet.HasChanges() to verify and then tableadapter.update to write the data before navigating to the next record.
That also works great.
Now, how do I capture and write data in the detail(bottom) form? all it has is the bindingsource passed in.
I have a partially working solution, where the top form actually uses a second tableadapter.update statement to write the the child table.. but it seems to take 2 record navigations for that to work. (at which point the data is actually updated correctly though)
Any high level better ways to work all this?
thanks
R
Looks like it was either a general issue with the event orders.. or maybe it's specific to the bindingnavigator or my setup.. but in order to get the bottom form's events firing BEFORE the record is changed in the top applet (when clicking directly from a modified grid row in the bottom, to the navigator), i had to explicitly move focus first in that top applet event. In my case, i trapped any click on the navigator and just ran this.focus(); that caused all the bottom form events to fire before continuing on. This then allowed my haschanges() check in the top form to happen after the bindingsource.endedit in the bottom form.

ASP.Net updatepanel and gridview issue causing unwanted scrolling

I have recently been trying to figure out a problem on my C# ASP.Net webforms website and finally found the cause but no fix.
Explanation of the problem:
I have a gridview in an updatepanel. This gridview holds images uploaded by the user and also imagebuttons. The image buttons cause a partial postback. The postback carries out an action on a selected image and refreshed the gridview.
This works great until I tested in firefox. In Firefox after the partial postback, the page scrolls up to the top of the GRIDVIEW (not the webpage).
Cause of the problem:
The cause of the problem was because the div that contains the gridview has no set height value in the CSS. This cause the div to shrink back to zero when the Gridview is refreshed and in turn causing the current position of scroll to be non existent (well it is but not in the div) and thus bringing the page to the top of said div.
Fixes tried:
Tried setting the height of the DIV to 2000px which stopped the scroll but meant there was lots of excess space (not acceptable and this option can not be used as gridview size is dynamically changing)
Tried JS code to move the page back to position it was before the partial postback (Also worked but the scroll moved up and the JS moved it down. This looked very unprofessional)
Tried to setting the div to 2000px before a partial postback and then resizing it to fit it new elements in and end request... not successful.

Performance issue with Dropdown controls

I have a requirement where i have to render large number of Dropdown controls on page,number of items in dropdown varies and it can goes up to 1000 items(not my design but my client). I am using Telerik controls on my page. As the number of controls on page increases the performance decreases and browser starts lagging sometimes it stop responding and hangs. To make it more worst client want this to be supporte on IE browser.Even design change is not acceptable. Please have a look to attached image. I am struggling since long to clear this but no luck.
My functionality in brief: By clicking on Add link new row is added on page dynamically(postback, redrawing all the controls again). On value change of first dropdown (i.e. Field column) the controls in Value column changes(again postback and redrawing all controls)
I see you're using individual controls that cost a lot of resources, and there is no other way to avoid it, more controls, more resources are needed.
In my opinion you could use a RadGridView with embbeded Controls and play with the appearence to give it the same look and feel, if you do it well the client may not note the diference.

C# asp.net Maintain tab index after asynchronous postback ontextchanged

Ok, so I've researched this to the end of the earth and can't seem to find a solution that works.
I have a C# application, which is basically a web form made up of radio button lists and text boxes in an update panel. The form has multiple 'sections', each of which the user submits when completed. Each control performs a postback. This is because if the user modifies a section after completing it, the 'section saved' label needs to disappear.
This all works well, except the postbacks lose the tab order of the controls. I have found code examples that save the last control that had focus, which works well for the radio button lists, but because the text boxes post back when a user tabs to the next control (not modifies the text), it doesn't select the next control. The user has to hit tab again and it jumps to the third text box, not the second because technically, the second text box is what had focus after the initial postback. I hope this makes sense.
Any ideas? I can post code if required.
I should probably also add that this page is within a frame of our community portal.

Silverlight combobox blocks interaction with other controls

I have a Silverlight view which has several layers of popups. It is a record search/edit page, which displays the results in a datagrid. There is a details view for each record that is then shown in a popup over the grid. Finally, the sections in the details view can be edited, and the edit form is displayed in a third popup. The search criteria is hidden when viewing data, but can be toggled into view.
The problem I am facing is that whenever the comboboxes on the edit popups are interacted with, it causes the layers below them to be un-clickable. In the screenshot I provided, if the user clicks on the Phone or Email comboboxes, even if they don't change the selections, and closes the topmost edit popup, then the delete, save, close, and view on map buttons no longer receive mouse interaction. They have mouseover styles that are not applied and they don't receive clicks. However, the New Group button does, but only below a certain point. It is behaving as if there is an invisible canvas/shape blocking mouse interaction.
Additionally, if the user slides out the Record Search panel (by clicking on the down arrow icon), the form somehow gets reset and those buttons are clickable again. Also, if the browser window gets resized the buttons are also clickable.
I've spent the better part of two days going through this, admittedly complicated, view and I'm positive there are no controls/canvases/shapes that I'm displaying that are being placed in the way, as I've added color/outlines to every canvas in the xaml.
At this point I am stumped and reconsidering redesigning the form to avoid this problem. Has anyone run into this and if so do you have a solution?

Categories