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

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

Can not display the value in combo box from main windows in another secondary window.

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :WPF

Hi All.

I have a problem : I have main windows with bind to sql combo box. I want to display at the start of second windows selected value from main win combo box in combo box which located in second windows. I have code that does this but I'm having trouble when I bind combo box from second windows to sql. More than I have this code that displays the selected value from main windows but everytime first row in sql table because a code is selectedIndwx = 0 ;

How can I change the code to display the selected value from the main window and bind combo box at the same time.

there is a code.

Main window.

private void button3_Click(object sender, RoutedEventAr

View Complete Post

More Related Resource Links

Windows UI: Our WinMgr Sample Makes Custom Window Sizing Simple


Programmers using Visual Basic have always had an advantage over C++ programmers when it comes to component and window sizing. There are many third-party Visual Basic-based solutions to this age-old problem, but unfortunately, there are few elegant alternatives for the C++ crowd, short of using a full-fledged windowing toolkit. This article explains how to circumvent the tedious task of hardcoded pixel arithmetic. It starts by introducing a window sizing rules system, and then moves on to show how CWinMgr, a data-driven class, can intelligently manage an MFC application's window sizing.

Paul DiLascia

MSDN Magazine July 2001

Windows Workflow : Activity Binding Properties Window Ellipses button not visible for one property

I have created a custom activity, when I am using this activity in workflow designer I am not getting the ellipsis button to select a property.  I am getting the ellipses button for first property LongValue while not getting the option for "NavigationUrl" property. This is the code for my custom activity. public partial class SetLongAsResult: Activity {         public SetLongAsResult() { InitializeComponent(); }         public static DependencyProperty LongValueProperty = DependencyProperty.Register("LongValue", typeof(long), typeof(SetLongAsResult));           public static DependencyProperty NavigationUrlProperty = DependencyProperty.Register("NavigationUrl", typeof(string), typeof(SetLongAsResult));           [Description("long value to be returned")]         [Category("Set Result Data")]         [BrowsableAttribute(true)]         [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]         public long LongValue         {             get             {         

how to open 2 different windows from different buttons with window.open or...

Hello, I'm trying to open 2 different windows from different buttons with window.open Do not manage... Annyone  who knows how? I need code xample...   Is it posible to set ID for this window.open ?   Thanks

MultiColumn Combo Box Does not display selected value

Hi, I have a WPF MultiColumn Combo Box in a WPF DataGrid Code :     <my:DataGridComboBoxColumn Header="Address" Width="200" x:Name="dgColContactAddr"   SelectedValuePath="CompleteAddr">       <my:DataGridComboBoxColumn.EditingElementStyle>     <Style x:Name="styel1" TargetType="{x:Type ComboBox}">     <Setter Property="ItemsControl.ItemTemplate" >     <Setter.Value>     <DataTemplate>     <StackPanel Orientation="Horizontal">     <TextBlock Text="{Binding Path=Address1}" />     <TextBlock Text=" "/>     <TextBlock Text="{Binding Path=Address2}"/>     <TextBlock Text=", "/>     <TextBlock Text="{Binding Path=City}"/>     <TextBlock Text=", "/>     <TextBlock Text="{Binding Path=State}"/>     <TextBlock Text=", "/>     <TextBlock Text="{Binding Path=Country}"/>     </StackPanel>     </DataTemplate>       </Setter.Value>

SharePoint 2007 - Survey list - Getting user's Windows account ID from a web service using display

Surveys...grrrr.   I am developing a .NET console application that accesses survey data from a single survey list using the MOSS web service "Lists".   I am able to enumerate the survey list and get to the items except for the author of the survey response.  When I get to the column ows_Author, it appears to be a lookup value formatted like this:  "1066;#JOHN DOE".   How can I, using web services alone, lookup the corresponding Windows login ID of that user?  If I go to the survey in SharePoint and click on the name in the view, it takes me to a site-based user profile page that does show the account ID I want.  The page that displays appears to be a virtualized page like this "_layouts/userdisp.aspx?ID=1066".   What I really need is JOHN DOE's account ID like "domain\id". Can I get to this with the data I have available? Thanks

How to sync main thread and new opened window

Hi all, I need to halt the main thread until some workflow is completed on the opened Window, the opened window has a user control content in which the user enter some data and click the button "next" . how can i halt the main thread and signal it to continue after the next button has been clicked? I've tryed using AutoRestEvent but the main thread get stucked and the window is frozen. ShowDialog wont help me, because i want to keep the window visible after the next button is clicked.     public void SomeMethod() { AppWizardStep2 step2 = new AppWizardStep2(ref myParams); Window myWin = new Window(); myWin.Content = step2; myWin.Show(); //Halt here // ...some logic that needs to continue after user workflow is completed on step2 user control }      

Launch window forms app from windows service

I have a windows forms app that is used to manage settings for a windows service. When the service starts I want to launch the forms app. I'm using Process.Start("myWindowsApp") and I can see the app running in the task manager processes but the windows aren't displayed. My guess is that it's because the service is running under the localsystem account but what do I need to do to make the windows forms app work properly? SteveR

Windows 7 window.open() and - target issue



In Windows 7 when I use window.open(url, "_MyWindow") a new browser window opens every time I click.

Expected behaviour is - URL is replaced in the browser window with the same target attribute (_MyWindow) if it's already open.

Any suggestion/workaround is greatly appreciated.

All works fine in any other OS/IE config, even on XP/IE8.




same issue appears using <a href=http://www.microsoft.com target="_MyWindow">Open link</a>

how to display the gridview in the popup window

hi, here i need to display the gridview  with in the popup window
for that the input parameter is the ratings id, it is in the dropdown i need to pass the ratings id to back end
if i select the ratings from the dropdown & click on view button the popup window should populated...
for that  my html code is
            <td class="orgDataLabels">
            <td class="orgDataArea">
                <asp:DropDownList ID="ddlratings" runat="server" Width="150px" Style="height: 22px">
                <asp:Button ID="BtnView1" runat="server" Text="View" ValidationGroup="g2" SkinID="btnGo"
                    OnClick="BtnView1_Click" />
                <asp:Label ID="lblrate" runat="server">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValid

Part of Window content not minimizing with rest of Main Window.


I am developing an IDE-like WPF application.  The application's main window from the Microsoft  has a number of child tool windows and tabbed document windows. 

The layout system for the main window's child controls has been implemented using the Composite Application Library.

Recently, a problem arose in which two particular elements of the main application window did not minimize with the rest of the window.  Instead, these two child elements stay up on the screen.  However, I cannot actually click on the unminimized region.  In fact, I can drag items from desktop through the unminimized regions.  The only thing that I can think of that may be causing this is that the content that doesn't minimize is executing within a separate AppDomain.  The two UIElements from the different AppDomain are remoted from an Add-In (System.AddIn).

Has anyone else experienced a similar windowing problem?

Outside border of a window in Windows 7



I have a defaut window with WindowStyle="None" and in Windows 7 I get a pretty big border - this not happens in XP. How can I get the width of this border?



Anoying Windows login popup window


HI all,

I have an application that uses Active Directory to validate users as well as populate a couple doopdown list, the application is connected to sql database on a seperate server.


When I first published the application I got an error from Active Directory I eventually found out that I had to embed a username and password within the code for active directory to work.  When i sorted out this problem I got one with my SQL and again used a username and password to allow connection to the database.


My new problem is when a user other than me logs in the windows popup windwo appairs requiring user name and password to login. The program is writen for windows authontetation but form where I check the person loged onto the computer and check username against active directory. After the person clicks the "OK" button a couple time they then have to click the close to exit the screen.

the user can look at a page but if they try any kind of processing they are required to log in again and this time they are not verified. 


I would like to get rid of the popup box and let the validation gor though like it dose in my location.


My IIS permision is set to windows authontecATION.


How do you change the color of the main frame on a Window in WPF?


I have an application where all windows have a very custom look/feel.  When the user has their theme set to Classic, or even set to certain default themes, the colors clash with my main app colors.

Seems like it should be easy to set a brush on the Frame portion of a Window in WPF but this appears to be missing from WPF.

I have searched around, but the only solutions have found involve making the main window transparent and manually creating the border and drawing the frame yourself and handling all the sizing/move options yourself.  I got this to work just fine, however I have a window on which I need to use INTEROP to show an HwndHost on a canvas.

HwndHost doesn't appear when being used on a Transparent window, so I simply cannot make the window Transparent without making my app useless.

I have tried setting the WindowStyle="None" and that gets me close, but shows an ugly thin frame around whatever I put on the window.  I wish "None" really meant none..  Unfortunately, it doesn't.

Does anybody have any way to override the color of the main window frame without making it Transparent or setting the WindowStyle="None" ?

Please help me out with a code sample if you have a good solution for this?

Thanks a bunch,



how to display sharepoint DocumentLibrary files details into datagridview of windows forms applicati



Now iam using sharepoint server 2007, here DocumentLibrary is having some files.

i need to display these files information into datagridview of windows forms application.

where datagridview columns are like

type        name (file name)   modified (date)        modifiedby     checked out to


i have the code like...




Recent Posts display not changing in main page!!! Most of them are static...



I have cleared browser cache, history and signed off, signed back in. I can see this header screen



Now, if I click Forums tab to navigate to forums.asp.net, I can see this


If you observe the screenshot, you can see the points are different and the posts are static (everything says few seconds ago).  Is it a browser caching issue or something else. I have seen the same thing since 3-4 hours.

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