.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How can I force a TabItem to repaint?

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :WPF

I have a WPF Window that has a TabControl in it. Inside each tab is a user control, one of which has another TabControl in it. Inside this tabbed user control, the user can interact with various data items that are two way bound to some Linq entities. There's a button on the control that calls "SubmitChanges" on the Linq DataContext, but I decided to implement a check to make sure data is either committed or discarded when this user control's visibility becomes hidden. This check displays a MessageBox asking the user to confirm if they wish to discard the updates (inserts and deletes automatically force a SubmitChanges, only Updates would be uncommitted at this point).

If the user clicks "No", I call Focus on the user control to allow them to click the update button, but if they click "Yes" and want to discard their changes, I want the tab they clicked on that prompted the change in visibility to now display itself, but instead, the user control with the nested tabs is still displayed in the content area, even though the outer tab control shows a different tab selected. It refreshes and displays properly if the user clicks onto a different tab and clicks back, but I think the fact that I'm displaying a MessageBox may be interfering with the tab switching. I've tried getting the SelectedItem from the outer TabControl, casting it as

View Complete Post

More Related Resource Links

Force password expiration after x days


Using C# and sqlmembershipprovider forms authentication, is there a way to force user password to expire and need to be reset after x number of days?

So if a user launches the website login.aspx page, when they type their userid, it will check if the password is expired and direct them to a Resetpassword.aspx page?

Get the controls from a TabItem's data template

Hello, I am using the following Style on a custom TabItem that I am using: <Style TargetType="{x:Type local:GSFTabItem}"> <Style.Resources> <cmn:EnumDisplayConverter x:Key="Converter" Type="{x:Type crys:GSFOperator}"/> <local:GSFTabVisibilityConverter x:Key="visibility"/> </Style.Resources> <Setter Property="DataContext" Value="{DynamicResource GSFObject}"></Setter> <Setter Property="Header" Value="{Binding Field}"/> <Setter Property="Content" Value="{DynamicResource GSFObject}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:GSFTabItem}"> <Grid> <Border Name="Border" BorderBrush="Black" BorderThickness=".5,.5,.5,0" Background="White" > <StackPanel Orientation="Horizontal"> <Label VerticalAlignment="Center" HorizontalAlignment="Center" Content="{Binding Field}"/> <Label Content="X" IsHitTestVisible="True"

Force Jit compile on assembly

I have CLR code that generates an assembly that I install into a database using the create assembly procedures. The code includes stored procedures and triggers. My separate applications, of course, call the stored procedures. My issue is that immediately after I install the library, the first time any of these triggers/procedures are called, it can take a long time for the event to occur. In a specific case (easily recreated on my end), if I hit a trigger with specific data in my record, something is occurring at the database level that is preventing me from doing a simple edit/save.  I think it's compiling the assembly.  It will work if I do an edit/save on another record, then go back to the first one.  Once that happens, the issue goes away until I delete and install the assembly, then it comes back for records that meet specific criteria. My conclusion is that it is taking so long for the JIT compiler, it's killing my post. So, question is: how can I force the jit compiler to process the assembly, either before or after installing the assembly to the database?  

How to force SendReply onto scheduler

I've run into a situation where I've noticed a SendReply message is not actually sent until a subsequent Delay activity (or another Send) is run in my CPU-intensive workflow.  Long story short, I'm testing out my "Cancel" ability by having one workflow (Controller) call into another (Worker), who will be performing some CPU-intensive operations. Sometimes, depending on some condition, the Controller will want to Cancel the Worker. I'm doing this by calling Cancel(...) on the Worker host's WorkflowControlEndpoint to forcefully stop the workflow and it's processing.  My workflows are hosted in WCF and look something like this: var Controller = new Sequence {   Activities =    {     SendRequestToWorker,                //Send     ReceiveResponseFromWorker,      //ReceiveReply (for above)     SendCancelIfConditionMet,           //If that may call WF control endpoint     ReceiveWorkerResults                  //Receive   }} var Worker = new Sequence {   Activities =    {     ReceiveRequestForWork,               //Receive     SendR

how to force my C# Winforms program run as administrator on any computer ?

hi how to force my C# Winforms program run as administrator on any computer ? and any kind of OS ? i need code solution (any sample code will be excellent) thank's in advance

Force SQL job to succeed even after a step fails in SQL server 2008

All, We are trying to force some jobs to succed even though one step in the job fails randomly. Now,we choose the property of the job succeed on failure, it still shows up as warning. How do we ignore the warning thrown by the job SQL job?? Any suggestions??   Thanks Kay

force document 'save as' for visitor users for all documents.

hello we are using foundation as the basis for a customer extranet, one of the 'features' of sharepoint seems to be the inconsistancy of how it handles office and non-office documents. for pdf's the user is prompted for save as. For word docs if the (remote Ad authenticated )user has word this opens the document for the site and reprompts for credentials, i usderstand why this is happening as they are opening the document on different network. the question is can i force 'save as' for word and excel documents in the manner of pdfs for visitor level users. Thanks Mark  


Hi. I have Microsoft SQL Server 2005 - 9.00.4053.00 (X64) and I want to configurate Replications. I have received an error which is similar to this here: http://dbfriend.blogspot.com/2010/01/error-occurred-during-decryption-when.html and I want to solve this problem with command ALTER SERVICE MASTER KEY REGENERATE FORCE. I would like to ask you what I can lose with FORCE option? I have read it should be linked server login passwords and credential secrets. Will this command ALTER SERVICE MASTER KEY REGENERATE FORCE affect the connections from linked servers which point to this machine from another SQL Servers? If I run exec sp_linkedservers, I receive 1 row where SRV_NAME is the same as @@servername. There are no other linked servers. There is a structure of data I have found. Please tell me if there is something which could be lost after the command ALTER SERVICE MASTER KEY REGENERATE FORCE. I have a few user databases but no data are returned when I run this command on them: EXEC sp_MSForEachDB ' Use ?;     select * from sys.master_key_passwords ;     select * from sys.asymmetric_keys ;     select * from sys.crypt_properties ;     select * from sys.certificates ;     select * from sys.key_encryptions ;     select * from sys.credentials ;     select * from sys.symmetr

how to open force SharePoint 2010 to open documents withint the browser instead of invoking word app

guys, when user clicks on the word document within a document library, it opens up in the word IDE , how can i change this so that documents opens up in the browser. the "Library settings\ advanced settings\ open documents in the browser" setting is set to "open in the browser"   thanks sameer

Why SQL accepts both encrypted connection and non-encrypted connections when force encryption option

I have installed a certificate and have set force encryption to yes under the flags' tab of protocols' window as well as SQLnative client configuration properties but SQL Server accepts both encrypted connection and non-encrypted connections,why?(i have checked the encrypt connection of the connection properties of connect to server window). also when i run profiler, it can capture both T-SQL statements which has run against encrypted and non-encrypted connection and i expect the profiler should not be able to get the encrypted connection's T-SQL statement,am I right or something is wrong with my  configurations?--yousef

How to force MVC Projects setup to use IIS as web server IN VS2010 Professional

Hi..I am creating a secondary app that will interact with some controller actions in MVC Site thus i need it running when i boot my Dev PC.   The problem is that VS2010 Pro always seems to create the site using the inbuilt VS Web Server. How can i change this setting?   Thanks

Force download box

Hello there, can anyone help me with my proble. The code below run perfectly. The only thing is that after the Sub DownloadFile (FilePath as String) is run the whole webpage seem to stop. The message "Download Completed!" never show at all. When I try to click on other links, it doesn't work as well. It only work when I click the refresh button. Any ideas why? Sub Download (s As Object, e As ImageClickEventArgs) DownloadFile (MapPath(FileUrl)) lblDownload.Text = "Download completed!" End Sub Sub DownloadFile(FilePath as String) If File.Exists(FilePath) Then Dim myFileInfo as FileInfo myFileInfo = New FileInfo(FilePath) Response.Clear() Response.ContentType = "application/octet-stream" Response.AppendHeader("Content-Disposition", "attachment; filename=""" & _ myFileInfo.Name & """") Response.WriteFile(FilePath) Response.End() End If End Sub Thaning you in advance for your help. Chan

how can i force to use index on table

I have go through execution plan,it shows me a table scan(10%) on a table who has the index column.then also it show table scan so how can i force it to use the indexe column from the table???   Thank's Digambar

InfoPath Repeating Table - Force new row entry

Hi,Wondering if anyone has had a similar situation.. I have an InfoPath form with a repeating table. When the user completes a row and saves the doc, I want this to be non-editable, so any subsequent changes have to be added as new row. Seems simple enough, but maybe it's just been a long day.. :) Any suggestions?Thanks,Laura

How to force a textbox to have insert mode off in WPF 4 vb.net.

I need my textboxs on my WPF form to act like the traditional insert key function where you could override characters as you type and not insert them. IE I need to turn off the defualt insert characters feature. It also has to be able to be turned on when needed. Thank you for reading, hope you can help!~Justin

how to force null in date field - access 2007 ?

hi i have table that contain date field. how i can force null or empty value on this field ? thank's in advance

Creating TabItem like vs2010

Hi, I want to create tabitems like vs2010, which can dock out from tabcontrol and it should become a window. Then If I want that window to dockin into tabcontrol. Is it possible ? Help will be appreciated. I dont want to use AvalonDock. Thanks, Rajnikant
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend