Blank screen is shown when xceed datagrid is loaded in model dialog(pop-up) in wpf application - xceed

I am showing DataGrid on my model dialog(popup). We are using WPF for showing xceed DataGrid. But sometimes instead of data blanks screen is shown. This is happening randomly, and we are not able to reproduce this issue. I tried by adding try catch but no exception is catched. Even there is no error in event manager,
This issue is happening on some specific machines. I have no clue why I am getting this error. Even I am not able to reproduce this because this is happening randomly.
My project is very large and so i cant send sample application.
Any help or suggestion is most welcome and please reply as this is a critical issue for me.

Hi This problem occurs if you are loading your data in UI Thread.
If the size of data is large then UI thread will be blocked and blank screen will be rendered by WPF.
Use background worker to bind your data.

Related

How to remove automatic scrolling in a winform application?

I have a winform ( Windows Form) application, in .NET 4.0. On the main screen, I have two DataGridView, one on the top of the second. If I start my application on a small screen (say 1024x768), I don't completely see the second DataGridView. When I click inside this second DataGridView, the screen automatically scroll to show me the complete DataGridView. I DONT want that behaviour cause now I cannot see important information in my first DataGridView!.
Then how could I remove this annoying behaviour?
FYI: my application is optimized for 1280x960 screen.
thank you very much
You might be looking for this
Setting this property to false should resolve the issue.

Strange rendering error in SL app... out of browser issue?

I've been working on a SL5 app for a few days. I've mostly been using a hard coded dummy data collection when styling my app's view. Everything has been working fine, but now I want to connect it to a dynamic data collection generated by my view model (using the data service technique where you have design time & real data depending on the IsInDesignTool property.
After I cleared out the control of the hard coded data and bound it to a collection in my view model. When I run it in debug mode, I see an unhandled exception being thrown in App.xaml.cs. The exception args don't say exactly what the problem is (it is simply saying "Value does not fall within the expected range" but when I look at the sender I find the following coming from the MainWindow (my app only has a single view): "Out-of-browser specific settings do not affect in-browser applications."
Further, when I try to view the MainWindow in the designer in VS, it doesn't render and instead shows an error (the rendered exception in the designer doesn't have any of my namespaces in it, just things about controls & UIElements).
I'm at a bit of a loss how to troubleshoot this. I didn't set anything for out-of-browser when building the app and since it worked with dummy data collections, why would it suddenly have this issue (seems like if I was using an out-of-browser property it would have shown up before I bound the data to the view).
Tips/pointers?
(sorry for my bad english)
I am not sure on what is happening but I saw the error "Out-of-browser specific..." when I tried to access some specific property only available to OOB while running on browser. The solution was to test if running oob before using the property:
if (Application.Current.IsRunningOutOfBrowser)
{
Application.Current.MainWindow.WindowState = WindowState.Maximized;
}
The other problem possibly is unrelated - and sometimes can be really hard to debug - one thing that helped me is to open another instance of VS and attach it to the one where you are seeing the problem. With this setup, go to your problematic View and change to "design view" - keep an eye on the Output window of the attached VS to see if some meaningful exception is shown.
I had a similar issue.
I did put a Textbox inside kind of Listbox (radPanelBar) and added
HorizontalScrollBarVisibility="Auto" to the Textbox. It seems that the textbox had problems when to show the scrollbar and when not. Adding
ScrollViewer.HorizontalScrollBarVisibility="Disabled" to the Listbox did solve it ( so, no OOB issue at all ).
I'm not entirely sure what the error was, but it wasn't at all realted to OOB. I'm using a data service approach (in design time I programatically build real data, not the Expression Blend sample data, but when not in a design tool, it uses the REST services). I started disabling a lot of things in my dynamic data and slowly added them back. Somewhere along the way my dummy data generation was fouling things up, but SL thought it was an OOB issue.

WPF Usercontrol performance vs window performance issue

I'm making an application to dynamically add user controls on a Canvas and drag them around.
First I made a window with a canvas to drag them in and everything worked fine.
Then i made a user control with the code from the window. I added the control to a new window and everything still was working fine.
Now I try to add my control to the main application and the performance is very slow. The controls still follow the mouse but very slow. The application does have several other user controls. Where does this huge performance hit come from and how can I avoid it?
The cpu only uses 50% and when it was working good it went to 100%.
Thank you for you're help
David
EDIT:
I resolved the problem.
By moving the user-controls there was an error in the image url wich prevented the application to run smoothly.
By changing the url's everything went back to normal.
Ive used JoshSmiths DragCanvas for this kind of thing. It work great with no lag.
JoshSmiths DragCanvas # CodeProject
I resolved the problem. By moving the user-controls there was an error in the image url which prevented the application to run smoothly.
By changing the url's everything went back to normal.
Make sure to check you're url's if you're having sudden performance issues.

DataGrid with AutoCompleteBox crashes Silverlight when scrolling

I have a Silverlight 4 application with a DataGrid. The rows of the datagrid contain two AutoCompleteBoxes.
Whenever the DataGrid shows a scrollbar and the user scrolls the grid, the entire Silverlight plug-in will freeze and crash. When I run it from the debugger, I usually get the following error right before the freeze/crash:
"Error: Unhandled Error in Silverlight Application Code: 4009
Category: ManagedRuntimeError Message: Element is already the child of
another element."
I have seen several suggestions on possibly related issues on the silverlight.net forums, like avoiding inline item templates, but I have not yet found a working solution.
What I'm looking for is any information related to this: causes, fixes, work-arounds, methods to further analyse the cause of the problem, anything that could help.
One workaround that I'm currently testing, and that seems to work in my scenario, is to put the DataGrid inside a ScrollViewer. This effectively makes the DataGrid as high as it needs to be and delegates the scrolling to the ScrollViewer, so any DataGrid-scrolling-related problems are hereby avoided.
The only drawback I have found yet (other than that it is a very ugly workaround): the header row of the DataGrid now scrolls out of view, of course, when scrolling down.

Strange "frozen" content of WPF Window bug

A few of my users are experiencing a strange bug. I have a simple WPF window that contains a few textblocks and buttons. After a short time using my application successfully the users that experience the problem report that the window's content becomes empty and only the border of the window is visible.
After remoting onto their machines I have confirmed that it looks like the content of the window is frozen. When the window first opens it appears like its see through and displays whatever is behind it. If I move the window around the same frozen image of what was behind the window when it opened stays there. If I bring something in front of the Windows (such as a browser) the "frozen image" in the contents will change to a frozen image of whatever was in front of it. I have discovered that the buttons are still active and clickable in the window, so it's not completely frozen it just seems not to be drawing the content properly.
The issue only seems to affect a small percentage of my users and I cannot recreate this issue on any of my test machines. Any ideas about what is happening would be greatly appreciated.
If you have a user that's willing to experiment to find a solution, have them Disable Hardware Acceleration in WPF. If this fixes the issue, then it's most likely a graphics driver problem.

Resources