.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

How to prevent combobox drop down from expanding on double click

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :WPF
Hi, I have a requirment to toggle the selected item of a combobox on double click. I am able to achieve this using MouseDoubleClick event for combobox. But the issue is, when I double click the popup for the combobox also drops down, which I need to avoid.   How can I do this.   Please help.   Thanks, P

View Complete Post

More Related Resource Links

Prevent double click


 G'day All,

     This is my first post, and I am new to programming. I have created a website written in ASP.NET (4.0) with VB.NET (10.0) as the code-behind. I have created a game that plays Aton, the boardgame, via the web. I have created a board with multiple imagebuttons and standard buttons that are enabled for the user to click as the logic demands. My problem is : I need to be able to disable all of the imagebuttons/standard buttons after the user has made a selection (ie clicked on anything available). Essentially this is double click problem that has been discussed in the past. Up to this point, I have been able to use javascript to disable a single button (which works well), but I dont know how to disable the lot !

     I have searched far and wide, but have not been able to find a solution that works with the modern versions of ASP/VB. I have a grid of over 50 imagebuttons/standard buttons that all require disabling after any selection. Any solution would work for me, ie freeze screen, overlay image or individual button disabling. My instinct tells me that a large overlay would be the best, but I would like it work in all of the modern day browsers (Firefox, IE, Safari, Crome and Opera)


Prevent double-click on button control



I've read several posts on this subject, but most solutions refer to using http://www.metabuilders.com/Tools/OneClick.aspx or to using javascript to disable the button (after the first click).  Both of these solutions would work, but I was hoping for some basic server code that uses the standard button control, and that I could re-use on various forms to prevent double-clicks.  Or if there are any good articles or suggestions on this that you could direct me to view I would appreciate it.  Thanks for your help!

Combobox SelectionChanged: Prevent firing for every keystroke?

Is it possible for this event to fire only when the user clicks an item from combobox with the mouse or when they hit enter on it like the old 2.0 combobox worked? I have tried messing aroudn with the new selectionchanged event but I cannot figure it out. I looked on the forums here for help but only found someone returning the even to fire only when items they type are in the combobox. Thanks all help appreciated.GINtech Systems Owner

How to get the combobox value inside Datagrid on Edit button click event

Hi     I have Datagrid template column like<DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn>DataGridTemplateColumn Header="Edit" x:Name="Edit" ><DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn.CellEditingTemplate></DataGridTemplateColumn>SelectionChanged="cmbDGTeam_SelectionChanged" IsTabStop="True" /></DataTemplate><ComboBox Height="22" IsEditable="True" IsReadOnly="True" ItemsSource="{Binding}" DisplayMemberPath="Title" SelectedValuePath="TeamID" x:Name="cmbDGTeam"  SelectedValue="{Binding Path=TeamID,Mode=TwoWay}"<DataGridTemplateColumn.CellEditingTemplate><DataTemplate><DataTemplate><TextBlock Text="{Binding Title}"/></DataTemplate></DataGridTemplateColumn.CellTemplate><DataGridTemplateColumn Header="Team" Width="75"><DataGridTemplateColumn.CellTemplate> and Edit button Template column <DataGridTemplateColumn Header="Edit" x:Name="Edit" > </DataGridTemplateColumn.CellTemplate></DataTemplate><Button Content="Edit" IsEnabled="False" x:Name="btnEdit" Click="btnEdit_Click" ></Button>&l

NullReferenceException in ReHosted Designer on double-click

Hi,   I have a WinForms application with a rehosted workflow designer (WF4) and although my xamlx workflow opens in the designer without error, I find that when I drill down into the SendReceive activities I get a NullReferenceException as follows: NullReferenceException: Object reference not set to an instance of an object, at System.Activities.Core.Presentation.FlowchartDesigner.CleanupFlowchart() at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)... I'm running on Windows 7 x64. Any help with this would be hugely appreciated. Thanks, Stuart  

OpenDialog box to open file with a double-mouse click

Hi, I am having a hard time trying to find an example that opens an opendialog box and allows the users to open the file with a Double-Click. Please help.   Thanks

Activity/State mouse double click

Hi, When I double click activity/state, the workflow designer sets that activity/state as root designer. Is there a way to  disable this behavior? Thank you

How to prevent click sound on Frame.Navigate()


I have an application with several different forms which need to be filled in one after the other, so I thought I'd use a frame with pages.

However, I don't want a click sound when navigating to the next page.

Is it possible to get rid of it?

If not I have just discovered that I can set the source Uri instead but it would be nice to be able to use Frame.Navigate().


GridView and mouse double click Response.Redirect problem


VS 2005, AJAX 

I use gridview and I need single and double click for each row in gridview.

When I click once on a row, some action will execute (e.g. next button should be enabled) and when I double click the row there should be redirection to another page.

I used the code below for both single and double click  usage:


protected void GwContainers_RowDataBound(object sender, GridViewRowEventArgs e)
                if (e.Row.RowType == DataControlRowType.DataRow)
                    // Get the LinkButton control in the first cell

                    LinkButton singleClickButton = (LinkButton)e.Row.Cells[8].Controls[0];
                    // Get the javascript which is assigned to this LinkButton


avoid double click event


Hi All.

I have two Parent forms and one child form. The child form has ListView with ability to double click row to call other form. I would like if ParentAAForm calls ChildForm user has ability to double click ListView row to call other form. But if ParentBBForm calls ChildForm in that case user doesn't have ability to double click LIstView row on ChildForm to call other form. If is it possible how it to do?


Button On client click event Loads Drop Down List


Hello All


Right now my ASP page has a text box and a submit button, what I am trying to do is once the user hits the submit button load a drop down list.


The drop down list should not be visible before the submit button is pressed


Thanks in advance 

SQL file will not open in SSMS on double-click (or jump list)


Hello, all.

I am running SQL Server Management Studio 2008 on a Windows 7 Enterprise machine here at work.  I am not sure when this started happening, but now, for some reason, when I double-click on a SQL file in Explorer, or from the jump list for SSMS (which I have pinned to my Windows 7 task bar), SSMS will open, but will not load the file in question, nor will it bring up a logon screen to connect to a DB.  I tried unassociating the .SQL extension and then re-associating it using "Open With" and it worked the first time (from the Open With), but then immediately reverted back to its old behavior.  Very annoying.

For now I just open SSMS first (which pops up a logon screen and things proceed normally), but that kind of defeats the purpose of having a jump list or a file association.  Has anybody run into this before and can anybody suggest a fix or what's wrong?

Thanks in advance for any wisdom anyone can provide. 

Multi-Column ComboBox that binds to it's Value and Display Members for the drop down

I'm looking for a MultiColumn ComboBox solution as well. I've seen a lot of people talking about using Templates and I have to admit I'm not entirely comfortable with using Templates yet in WPF.

What I'm looking for specifically is a ComboBox that simply shows a two column drop down that displays the values resolved from DisplayMemberPath and SelectedValuePath for each item of the bound ItemsSource of the ComboBox. Once one of the items is selected I'm looking for the SelectedValue only to be displayed in the Text area.

Below is a crude diagram to explain what I'm looking for.

|CODE1 | Display value 1 | |
|CODE2 | Display value 1 | |
|CODE3 | Display value 1 | |

I've fumbled around using RelativeSource and a few other things but nothing works so far. If anybody has a clue about different ways to implement this I would love to hear them. A quick example using templates would be wonderful but also note that I'm planning probably to make this a reusable control in our solution since this is a common paradigm in our UI that I wouldn't want to have to repeat on each Window or UserControl in various projects.

Double click an associated file type and have it open in your WPF application?


I have a WPF application that does a number of things. When running the app, I can go to File > Open, browse to a file, and open it in the app. Fields on the UI are updated with values from the file and everything works great.

The file I am opening contains binary data and has a custom file extension that is associated with my application. The problem is that if I DON'T have the WPF application running and I double click one of my associated files, it simply opens the application. I would like it to open the application and then load the contents of the file I clicked on. How can I go about doing this?

I have looked into using the Application_Startup event handler in the App.xaml.cs but cannot get the filename when double clicking on it as my StartupEventArgs are empty. However, the sender.ToString from Application_Startup handler returns "MyCompany.MyApp.App". How can I get the filename and go about loading it?

Another thing is that if I put a breakpoint in the Application_Startup event handler and double click my associated file, I never hit the breakpoint. The only way I hit the breakpoint is when I run the application from the IDE. I would like to be able to double click a file, then hit the breakpoint so I can do some debugging.

Thanks in advance.

DataGridComboBoxColumn - Auto drop down on single click


I have a DataGridComboBoxColum in a DataGrid.
I would like to be able to click on the cell one time and have the combobox drop down.
Currently you have to click multiple times.

How is this done?

  DisplayMemberPath="{Binding Path=color}" 
  SelectedItemBinding="{Binding Path=color}" 
  Width="Auto" MinWidth="100"

In SQL Server Management Studio can you double click in column data?

I'd like to easily see data in the results data grid, for instance xml or a particular value so I can cut and paste it quickly. Is there a way to double click in column data for popup to appear so can see full data item and make edits immediately?

Double click requirement to open menu

Hi, In my application, The main form (having main menu on its top) opens an other form calling .show() method. While the second form(Called via .show() method) is in front of main form, if I click on the menu of Main form it requires 2 click. First to activate the main form and then the second one to open the menu drop down. Is there any way that I could open the menu of main form in the above mentioned scenario in 1 click only. Thanks & Regards, Maverick.
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