.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

Removing buttons from canvas

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

I'm working with Visual Studio 2008 and I have created a window with a Canvas in a ScrollViewer. On the canvas, I've placed an image and the code I've written places buttons on the canvas at certain locations. So far, so good, but I'm also trying to delete certain buttons that have a certain content. My method looks like this:


 RemoveDataPointFromVisualization(DataPoint dp)
 content = generateContent(dp);

 (Button btn in
 (btn.Content == content)
  } } }

I think my problem lies with the loop, as I don't know for sure if this is correct; does it loop over all the buttons that are children of the canvas? If that works, the contents of the button, which have been generated by generateContent(), are compared to the content that is generated the moment this method is called.

What do I do wrong?


To provide some more information: every time I execute my program, it displays this er

View Complete Post

More Related Resource Links

Gridview with Radio Buttons

As now, Radio buttons are HTML controls, I am not able to get it on server side. When user select any radio button and press submit, Control will not available at code behind, you can use "e.Item.FindControl" as it is not "runat='server'". I want ID "Primary Key" value for selected radio button. To achive this I took the help of Javascript. I wrote javascript function that sets the values of "Primary Key" in hidden field when user clicks on any radio button. Now when user clicks on Submit button, user can get selected value froim hidden field.

removing item from datatable


hi to all ..thanks in advance


I have Two datatables dtA,dtB ,both contains column name is "FiledName" I need to remove item

from dtA when same row data exists in dtB.  please tell me how to do it

dtA    dtB   

 A        A

 B        F

 C        C

 D        Z

I want o/p like this







Buttons with Mouse-Over Behaviors - Redux

I recently posted some CSS and HTML snippets for a buttons collection I was using for a Menu style UI Scott Koon from www.LazyCoder.com posted a comment with a better way (thanks Scott). This way I don't have to set the CSS Class for each button. Just contain them in a div. Here is the [...] Read More......(read more)

single form multiple buttons in MVC


In a single page  has two buttons , ddown and tempname.

I wrote two actionresult separetly each one for ddown and tempname.

I need one is post and another one is get method. so i gave like

1. Get Method


        [AcceptParameter(Name = "button", Value = "tempname")]
        public ActionResult ddown_tempname(string statusName, NewsLetterAdminViewModel viewModel)

return View();



2.Post Method


        [AcceptParameter(Name = "button", Value = "ddown")]
        public ActionResult ddown(string statusName, string button, NewsLetterAdminViewModel viewModel, FormCollection collection)

return View();



if i call the post method its worked well. but if i call the get method, the code does not execute. the brea

Ajax.BeginForm with multiple buttons


can i have more than one AjaxOptions in Ajax.BeginForm targetting different controls?

Actually I want to exchange data between two listboxes placed in a single ajax.beginform.

How to do it..................help me.

Edin, New and Delete buttons in gridview?


Hi guys. I have gried view that shows me all info from the table i made. So my SelectCommand works fine. I'v add 3 additional buttons "new", "edit" and "delete" i'v made their query but still have mistake by clicking it in browser. I follow from the book Begginer to Novice 3.5 ASP C# but that's what it's shown. I know something missing. I'v check in the net but not found how to fixed, because i use SqlDataSource. Can you advise how to proceed from here? Here's what i did:

<asp:SqlDataSource ID="SqlDataSource5" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:ThisIsMyConnection%>"


              SelectCommand = "SELECT * FROM [Resident] WHERE (([FNAME] + ' ' + [LNAME] LIKE '%' + @FANDLNAME + '%'))"


              UpdateCommand = "UPDATE Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum, HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum WHERE FNAME=@original_FNAME AND LNA

Series of Radio Buttons in MVC


Hi.  I'm fairly new to MVC and admittedly don't fully understand how data is passed between Views and Controllers.  That said, here is my issue.


I am working with C#.  I have a page which has a list of items.  Each item has a radio button set of three associated with it and there are 15 of these sets on the page.  Thus I have radio1, radio2....radio15, etc.  Each of these has value 0, 1, or 2 upon submit.  I can't seem to understand how to get the information out of these radio button sets from the controller without passing 15 different variables to the post method in the controller which is associated with the view; ie passing Int32 radio1, Int32 radio2,.., Int32 radio15, etc.

I tried using ViewData["radio"+i] in a loop to access the value of each radio button set, but this, apparently can only be used to pass data to the View from the Controller and not the other way around.

Any advice is appreciated.



link buttons are not working in Blackberry bold (9650, 9700)



we have deveoped a mobile application . and have some link buttons  ,thease linkbuttons are working fine with blackberry curve but not working when we use Blackberry bold (9650, 9700)


center two buttons horizontally in form in C#

I have two buttons that are side by side. I want to center them such that they are equal distance from the left and right sides of the form. I want to do this at design time. This was easy to do in VB6. Not sure how to do this in C#.  If this isn't easily done at design time, how do I do this at runtime?      

Textwrapping with buttons not working as expected

Guys and Gals, Got a bit of a problem with my application. I am trying to get the text and buttons in a groupbox to wrap when the page size changes (i.e. gets too small to fit it all on the page.) I have inserted the TextWrapping="Wrap" into the TextBlock line but it refuses to wrap. I have tried everything I can think of for this. Am I doing something wrong or is it impossible to do? If someone could point me in the correct direction it would be greatly appreciated. I don't want to use a scroll viewer either. <Window x:Class="Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Width="Auto"> <StackPanel> <TextBlock >Load Data Mappings From File</TextBlock> <TextBlock TextWrapping="Wrap"> This task will truncate all existing data Maps and re-import from an excel spread sheet.<LineBreak/> </TextBlock> <GroupBox Header="File to Load" Name="groupBox1" Padding="10" Margin="10"> <StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center" Width=&qu

Removing Xml Namespaces from XmlSerialization

I am currently using Xml Serialization to serialize my classes in Visual Studio 2010, but I have been unable to remove the default namespaces that get attached to my document. These two elements get attached to the root of my document each time. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" When I specify my XmlRoot attribute on my class, I have tried both methods: [XmlRoot("requestor", Namespace="")] as well as <pre lang="x-c#">[XmlRoot("requestor")] Both of these methods have continued to result in the namespace being appended to my XmlDocument. This is currently the method I have been calling for my Xml Serialization: <pre lang="x-c#">/// <summary> /// Performs XmlSerialization of a particular object/class /// using the .Net Xml Serializer /// </summary> /// <param name="objForSerialization">object or class instance to be serialized</param> /// <returns>string containing the serialized object in Xml Document format</returns> public static string XmlSerialize(object objForSerialization) { string strSerialized = string.Empty; using (MemoryStream memoryStream = new MemoryStream()) { XmlSerializer serializer = new XmlSerializer(objFo

BIDS undo/redo buttons

In MS Visual Studio 2008 on Windows Server 2008 or BIDS my undo / redo buttons are grayed out when I am editing an SSIS package. I would like to know if there is a way to enable this. I have searched and searched everything looks retardedly complicated to get this working. Help? Anyone, anyone... Microsoft are you there?

removing guest account from sql 2005 databases

I cannot remove the guest account from my databases.  I know that I cannot and should not remove the guest account from master and tempdb.  but when i try to remove it from other databases I get some message about the guest account being a in schema or something like that.  so what should i do? thanks

Any issues removing backup mount point cluster resources from SQL Server dependencies?

Win 2003, SQL 2005/SQL2008 64 bit enterprise failover cluster with 3 nodes and 6 instances. The mount points configured as cluster resources for the data/backup/logs. The entire cluster mount points are SAN replicated to a DR Site. But backup drives/LUNs are excluded from the replication. All the disk resources including backup LUNs are set to dependencies on the SQL Server server. The SQL Server is not coming on-line in the DR Site due to unavailability of the backup LUNs (failed resources). As per the documentation all the disk resources must be set to dependencies (http://support.microsoft.com/kb/835185). Thought it did not specifically mentions only Data/Log mount points and/or the backup LUNs as well. "The SQL Server 2005 resource depends on the SQL network name resource and the physical disk resources that hold its data. When mount points are being used together with the physical disks, each mount point must appear as a cluster resource. Additionally, each mount point must also be added as a SQL Server dependency. If only the root physical disks dependency is added and the mount points are not added, database corruption will occur on failover. Database corruption may also occur when SQL Server is restarted without failing over. "     What if I remove the backup LUNs from dependencies list. This will allow me to recover the SQL Server

Problem with "Edit" and "Delete" buttons in gridview!

Hi everyone. I have problem with the buttons Edit and Delete in Gridview for very long time and i really need help about it. So i have gridview and sqldatasource. First i try to make this buttons manually and as you will see in sqldatasource 5 and 6 i have these buttons my records show up but the buttons not working. After that i was advised to do it automatically with gridview smart tag options and Generate columns - this is what i did in sqldatasource7 and gridview7. But both ways i need to change the statements with my own because that what they create not works. So select statement works. Now the error that i get in both ways is the same:The GridView 'GridView(the number could be 5,6 or 7)' fired event RowEditing which wasn't handled.See how looks my page:Now here's my code in aspx:<%@ Page Language="C#" Title="Specific Search in Phone Directory" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="serv
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