.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

Isenabled property in WPF not working on mouse right click

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


   I set Isenabled =false on a paticular condition using trigger evry thing got disabled but mouse right click is working and Getting selected,can any one let me know how to resolve this issue.


Thanks in Advance

View Complete Post

More Related Resource Links

Dynamically creating Gridview Template - Linkbutton Click not working



I have written some code to dynamically generate template columns for gridview which works well. However, each cell in the gridview has to be a linkbutton, which when clicked does a db update and redirects to a specific url with some parameters in it.

I have attached a click event handler to the linkbutton in the InstantiateIn method but the event does not seem to fire.

Could someone please help? the code is below -

//Dynamically creating the Grid

protected void btnAnalyze_Click(object sender, EventArgs e)

Context Menu And Mouse Click Issue

Hello. I am trying to show a context menu at runtime on MouseRightButtonUp, while over a selected image. I also have left mouse button events set up for the selected image. For some reason I cannot get the context menu to show unless I click the left mouse button and while it is held down click the right mouse button and keep it down while I release the left mouse button, followed by releasing the right mouse button. I tested the MouseRightButtonUp event using a simple MessageBox and did not have any problems; it worked as expected when the right mouse button was released. Here is the code: //add behavior for right mouse on this image. img.MouseRightButtonUp += (sender, e) => { //Create Context Menu ContextMenu menu = new ContextMenu(); //img is an Image img.ContextMenu = menu; //Add context menu item MenuItem photoNewWindow = new MenuItem(); photoNewWindow.Header = "Open Original Image"; photoNewWindow.Click += OpenOriginal; //Add menu items to context menu menu.Items.Add(photoNewWindow); //change the current image currentImage = img; }; // add behavior for mouse click on this image. img.MouseLeftButtonUp += (sender, e) => { // left mouse stuff }; Thanks! 

mouse click event

there are many control lack this mouseclick event, though they have the mousedoubleclick. in this scenario: i click on obj1, holding the click, move it to obj2 and release the click you see here obj1 is mouse-down, but mouse-up is obj2 so, do you count there's a mouse click event happened here? if you count it, which object will you consider should receive the mouse click? or is there a better way/algorithm to handle this mouse click? in my view, there's no mouse click happen, unless the down and up are happened on same obj.

click events not working in webparts

I tried to initiate the click events in my webpart.for simple test, Once I clicked the button it should set the label as empty string. But my click events not working when i integrate this webpart in my site. code    protected override void CreateChildControls()         {             base.CreateChildControls();             TextBox tx = new TextBox();             Button btn = new Button();             btn.Text = "Send to Consumer WebPart";             btn.Click+=new EventHandler(btn_Click);             this.Controls.Add(tx);             lbl = new Label();             lbl.Text = "Thank God!";                         this.Controls.Add(lbl);             this.Controls.Add(btn);        &nb

Open ContextMenuStrip on left mouse click on NotifyIcon

Hi,I was working with an application and faced this problem, I have this code :public partial class Form2 : Form    {        public Form2()        {            InitializeComponent();        }        private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)        {            if (e.Button == MouseButtons.Left)            {                contextMenuStrip1.Show(this, Control.MousePosition); // Or any other overload            }        }        private void Form2_Load(object sender, EventArgs e)        {            notifyIcon1.Icon = Icon;        }    }Here, in design mode, i have set contextMenuStrip1 as notifyIcon1's ContextMenuStrip. When I right click on notifyIcon1, it opens the context menu and when I click somewhere else, it closes. But with my code opens the contextmenu on left click and when I open context menu that way, it shows in taskbar and doesn't close when I click some where else.In short, I want to open contextmenustrip when user left clicks and right clicks on the notifyicon and it works well with right click by default but not with left click. And I want to avoid using SendMessage to send left click message.Is there any way I can work this out?

Implement Mouse Click event in AxShockWaveFlash

Hi, I want to hide the AxShockWaveFlash control when I clck on it. public class myAxShockwaveFlash: AxShockwaveFlashObjects.AxShockwaveFlash { private const int WM_LBUTTONDOWN = 0x0201; protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_LBUTTONDOWN: { Visible = false; // I also tried SetVisibleCore(false); } break; } base.WndProc(ref m); } } There are no errors while debugging. Unfortunatelly the AxShockWaveFlash doesn't disappear. If I use methods instead that are defined direct in AxShockWaveFlash (like Play(), Stop(),...), the source code will work. Why does it not work?

Seadragon mouse wheel motion zoom/zoomout not working

using following code.. vs 2008 andajaxtoolkit 3.5.40412.2what is is to be done to make it work? <form id="form1" runat="server"> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </ajaxToolkit:ToolkitScriptManager> <ajaxToolkit:Seadragon ID="Seadragon2" Height="500px" Width="500px" runat="server" SourceUrl="dzc_output.xml" MouseNavEnabled="true" > </ajaxToolkit:Seadragon> </form>

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

<%# eval> not working for a simple property

<form id="form1" runat="server"> <div> <table> <tr> <td>Name: <%#customer%> </td> </tr> </table> </div> </form>        Partial Class ScorePage Inherits System.Web.UI.Page Private _customer As String = "Sachin" Public Property customer() As String Get Return _customer End Get Set(ByVal value As String) _customer = value End Set End Property End Class   The expected result in html page is Name: Sachin But i am getting Name: property is not getting displayed. I thought instead of creating a label control, we can use this method, but it is not working  

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

Member_Caption property not working in SSAS 2000

Hi, I need to pass a parameter to my SSRS report which is based on an Analysis services cube (AS 2000). I have created a query which will return me the members of a hierarchy that I can pas as a perameter. Interestingly the Member_Caption property is not working. In MDX Sample application it is returing "#err" in the column and when I run the same command in my SSRS MDX editor ( I am using OLEDB connection alongwith analysis services 9.0 client) I get empty space. My query is, WITH     Member [Measures].[ParameterCaption] as '[PRODUCT].CurrentMember.Member_caption' MEMBER   [Measures].[ParameterValue] AS '[PRODUCT].CurrentMember.UniqueName' MEMBER   [Measures].[ParameterLevel] AS '[PRODUCT].CURRENTMEMBER.LEVEL.ORDINAL' SELECT   {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , { Descendants([PRODUCT].Currentmember,1,leaves)+(Descendants([PRODUCT].Currentmember,2,leaves))} ON ROWS from   [My_Cube] Am I making any obvious mistake here ? I have used similar queries before and they have always worked (With SSAS 2005) Thanks in advance, Suman  

Suppress mouse click event following LostFocus


I have a Canvas which handles mouse click events. When the mouse is clicked it will pop up a TextBox at the position of the click. The TextBox subscribes to the LostFocus event and will make itself disappear when this event is fired.

What happens is: the user clicks, text box appears, user types, user clicks outside textbox (to finish the text entry process), the text box disappears, a new text box appears at the position of the click.

What I would like to happen: when the user clicks outside of the text box I would to suppress the click event so that the text box disappears and a new one does not appear.

Many thanks,


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


confirm JS is not working on imagebutton click


Dear Frens

I have a new issue, which i want to share.

When working with ASP.NET 1.1 Framework there is an imagebutton on click of that imagebutton client side validations are fired since it is an online application form

cline side validations are must i am using a javascript when user submitting the application form

for confirm messege .

but it is not working ... if i do the causevalidation="False" for the imagebutton it is working but the validation are bypassed.

How to achieve this please suggest

Thanks in Advance


property setting in report server (2008) config file is not working as expected.



I have set the <WorkingSetMinimum> property to 2.4GB in my reportserver 2008 config file.

By defintion, <WorkingSetMinimum> setting means,

  1. Lower limit of service memory consumption; memory will not be released if the consumption is below this amount, though the service will not reserve the designated amount of memory when it starts.
  2. If service uses more than the designated amout of memory, it will release back the memory only till this declared value and not beyond that, which means it should keep 2.4GB as designated.

See this link for definition: http://books.google.com/books?id=mzY_Xo_9J-gC&pg=PA589&lpg=PA589&dq=What+is+%3Cworkingsetminimum%3E+in+report+server+configuration+file&source=bl&ots=r_xhRp8erj&sig=E_o0-Dh2SXOgMNrW3sptt5oZrYI&hl=en&ei=f5mjTNeNM5O8ccmErJMI&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCAQ6AEwAw#

click a button to pop up new window to pass a value; is working on second click onwards


Hi all,


i am facing a problem to make a button onclick to pop up a new window with pass a value. it only working on second click on onwards.

i check the checkbox from a table then pass the ID for each data to another page.

below is my coding: hope anyone can help me. this is i add in button click; the PIID is a value i want to pass


 Protected Sub btn_download_in_excel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_download_in_excel.Click


        Dim keyID As String = ""
        Dim CheckedItems As SortedList = ViewState("CheckedItems")
        Dim ChkBxIndex As String = ""
        Dim strPsId As String = ""
        Dim PIID As String = ""
        Dim rows() As DataRow

        Dim CheckedItemsKeys As ICollection = CheckedItems.Keys
        Dim keys As IEnumerator = CheckedItemsKeys.GetEnumerator

        While keys.MoveNext
            If Not IsNothing(CheckedItems) Then
                ChkBxIndex = keys.Current
                keyID = ChkBxIndex

                rows = pLookupDataSet.Tables("CCL_TB_PART").Select("PIID = " & Cmn.QStr(keyID))

                If String.IsNullOrEmpty(PIID) Then
                    PIID = keyID

DataTrigger bound to a datebound property using a converter not working.


Hi all, this will sound like a simple problem but I am really stumped!

I'm trying to create a TextBlock with a style that collapses when the text is "" or null. So in the style there's a DataTrigger bound to Text using a Converter that provide a boolean test for "" or null.

The problem is that the triggers never seem to fire. Debugging the converter suggests it never gets used. The debug output also doesn't warn me of failed bindings so I have no idea what is going wrong!


			<GlacialControls:IsNullOrEmptyStringConverter x:Key="isNullOrEmptyStringConverter"/>
			<Style x:Key="Co
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