usercontrols

(WPF) UserControl or CustomControl?

I need to build a specific interactive drawing "canvas". In that canvas, user will be able to place graphic elements - points linked with lines. I have a ready WinForms UserControl - pointsList that represents the list of points presents in the canvas. PointsList is able to add and remove points, link them with a line. pointsList sh...

ASP.NET: custom control (or user control) with property of type List<Something>. Can the property be set in the ASPX source?

I have a user control with a property of type List<Something>: Private p_myList As New List(Of Guid) Public Property MyList() As List(Of Guid) Get Return p_myList End Get Set(ByVal value As List(Of Guid)) If value Is Nothing Then Throw New ArgumentNullException() p_myList = value End Set End Prope...

Adding Custom UserControl to Visual Studio 2005's Toolbox

I'm using Visual Studio 2005 for a project I'm working on right now. I've created a new, custom control that inherits from 'UserControl'. Now I need to add that control to another Windows Form within the same project. I thought that the IDE would place this custom control into the Toolbox (as I know it's done in the past when I was usi...

wpf - UserControl inheritance

Hi I have problem with control inheritance in WPF. I created a UserControl named BaseUserControl. I want for this control to be a base control for other WPF userControls. So I another UserControl called FirstComponent. In next step I changed this code FirstComponent : UserControl to this FirstComponent : BaseControl However during...

How can I ensure that WPF UserControl elements are visible outside the bounds of the control?

I have a UserControl containing interactive elements within a grid. The user can move and resize these elements, often causing them to fall outside the bounds of my control. When elements do fall outside, I don't want them to clip. I want them to be visible no matter what. Unfortunately, setting ClipToBounds to FALSE did not solve th...

raising event in a usercontrol from another usercontrol

How to raise a event in usercontrol from the another usercontrol. i tried to do with delegates, but it doesnt work. How can i do this. am using C#(WPF) usercontrol1.cs public partial class UserControl1 : UserControl { delegate void myDelegate(); public UserControl1() { InitializeComponent(); } private...

How to arrange the elements?

I need to place objects 40% 40% 20% and that there were no scroll <Grid Grid.Row="1"> <Grid.RowDefinitions> <RowDefinition Height="40*" /> <RowDefinition Height="40*" /> <RowDefinition Height="20*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDef...

Event in User Control

I have a problem with button event in web user control First i have an aspx like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddTest.aspx.cs" Inherits="AddTest" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3...

Why are Buttons Outlined?

Im trying to create a button in C#. When i do it always sets it up so theirs this outline around the rounded edges of the button itself. I'm trying to change the background color of my form but these buttons look squared instead of the rounded edges like their supposed to... see attached picture.... p.s. code is the normal code... just ...

can anyone help me please - validator in modal popup prevent my button from postback

i m using asp.net .net 3.5 with c# and ajax control toolkit i have a very strange problem for some reasons i m forced to use the following solution i have a situation that includs a validation control inside a usercontrol that is loaded on the page using a modalpopup when i click a button from inside a gridview the problem is that t...

Why is this DropDownList data binding to a List<String> not working?

I'm trying to bind a List<String> to a DropDownList in a user control. I think I'm doing the right thing, but it seems that after my code executes the bindings are cleared. Here's the code for review! User control: <asp:DropDownList ID="subjectNameDropDown" runat="server"/> <asp:DropDownList ID="yearLevelDropDown" runat="server"/> Au...

problem with RowCommand in GridView

Hi, have this weird problem with the first click of a row item in a gridview where it doesnt fire. Im loading up a user control dynamically into a placeholder. After the first click fails, subsequent clicks are fine, and the RowCommand event fires. Any suggestions appreciated protected void Page_Load(object sender, EventArgs e) ...

Adding x:Name to a user control gives error in generated code of page its used in.

I am basically using a user control for the first time, so hopefully it's just a dumb mistake. I have a simple user control <UserControl x:Class="TestProject.WebApp.myUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas....

Convert UpdatePanel to Panel in code behind

The CMS I use struggles with UpdatePanels in some of my custom controls and master pages during edits. I'd like to convert them dynamically to regular panels on Page_Load or Page_Init or something based on whether the page is being edited. I'd like to convert all the UpdatePanels on a page to Panels dynamically. Finding the UpdatePanels...

ASP.NET MVC - Dynamically set properties of UserControl not rendering correctly

Hi, As a follow on from one of my previous posts (ASP.NET MVC2 Master Page - Server side script not rendering, first bracket being escaped) I now having a similar problem. This time it is with trying to dynamically set the properties of a UserControl. *For anyone familiar with N2CMS, it is the AdvancedPager control. Here is what I a...

ASP.NET loads all assemblies in bin to find a user control

Part of a web application we have uses an in-house web control assembly. This assembly contains several web user controls where several of these are used by other web controls within the same assembly. The assembly is built as a website with a web deployment project. The main web application's pages are dynamically compiled through a s...

Using VS2010, is it possible to alter the size of the smart tags popup on a control?

I'm coding a control with SmartTags support. Works fine however the size of the popup is too small. Is there a way to increase it either programmatically or from the IDE itself? ...

Is there a way to set textblocks to static on a UserControl in C# before compile?

EDIT: Apparently I was a little confusing. The original post will remain below, but the main thing I'm asking is if there is a way to make a textblock on a usercontrol static, so that when I try to set it's value with a static method, it doesn't whine and say "An object reference is required for the non-static field, method, or property ...

Drag'n'Drop sortable Listbox für Windows Phone 7

In a Windows Phone 7 application I got a ListBox containing a few items. I want the user to be able to sort the items in the ListBox by just touching and dragging them (on the left part of the ListBox template). How would I implement this? Is there a standard way or control to get this kind of drag and drop functionality (preferably eve...

Implement NumericUpDown spinner control on Windows Phone 7?

I need a control to enter small numbers on Windows Phone 7 and would like to have some kind of endless spinner control like the one for entering day and month and the date setting of the device. Is there a standard control to spin through these kind of selections? Or at least some way how to build this kind of control? ...