usercontrols

Why would putting a no-op Converter on a Binding change its behavior?

I'm in the midst of testing a user control I've built, and I'm encountering something that's inexplicable to me. The control's an extension of the ComboBox that handles values of a specific custom type. It has a dependency property of that custom type that is the target property of a Binding. I've got a trace statement in the setter...

Converting ASP.Net Web Form to User Control OnPreInit event

I'm in the process of converting an ASP.Net webform into a User control and there an event that now says no suitable method found to override the event code causing the compile error protected override void OnPreInit(EventArgs e) { //do some stuff base.OnPreInit(e); } Is there any equivalent for a user control? ...

XAML Designer "cannot find type" when converters are in UserControl.Resources

I have a WPF UserControl with binding converters referenced like this: <UserControl x:Class="MyControl" x:Name="MyControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:TheMainNamespaceOfThisAssembly"> <UserControl.Resourc...

What Namespace is the Default attribute for properties on UserControls?

I found half of the answer here to my question when searching "what is the attribute to set the default value of a User Control property in the designer where you change it and it bolds". However the answer neglects to mention the namespace it is in. Searching through Object Browser yields hundreds of classes/properties with the name D...

How to set a property by calling a method

Hello, I'd like to know how to set a custom property of a custom user control by calling a method that would serve as "data provider" for that property. What I mean is I'd like to write something like this: <CatsUserControl Cats={FindAllCats} />, where CatsUserControl is a User Control I created (which has a Property named Cats), a...

Silverlight stop page closing before being saved

Here's a question for all you Silverlight guys. In the old days for WinForms, if your user was creating/editing some information in a DialogBox, it was easy to detect the Window closing and if the data was dirty, ask if they wanted to save. My question is, how do you approach this scenario in Silverlight where everything seems to be do...

Interactive Design-Time User Control

Hi All I apologise if the title was confusing, it took me nearly 5 minutes to finally think of a title for this one... Okay, you know how in Visual Studio Express when you add a TabControl to the Form, and you can click on the right-arrow on the top right of the TabControl and it will add a new TabPage, or remove one? Well, I'm creati...

Best practice for dynamically adding controls through copying existent controls in WPF

Hello! I have a TabControl. While clicking a button I want to add a new TabItems to the TabControl. Among various techniques I've chosen to create UserControl inside of a DockPanel. Everything works fine, except for the location of control on a new TabItem is not 0 and it is not expanded on the main form resize. Everything is quite simp...

Hide resize markers in designer using C# ?

Usually when you select a control in designer it will show resize markers (little white square boxes) around it. I want to make my control non-resizable , and I partially implemented it by setting the size in OnPaint but the markers are still being shown and you can still drag them (but the control returns to it's previous size immetiate...

How to Put One WinForms User Control on Three Forms and Update All Three Simultaneously?

How to Create a UserControl which for example 3 winforms and 1 UserControl, adding UserControl to all forms but if user by click in one of the forms changed UserControl content, all forms display the same changes. Edited I think it working now. the dark area is the usercontrol with some content ...

How to get Embedded Editor Control of UltraWinGrid on CellChange Event

I am associating a user control as Editor control of UltraWinGrid in InitializeLayout event. What I am trying is to retrieve the Editor Controls instance when I am chaning cell value. ...

User Control Events

I have a user control with a button named upload in it. The button click event looks like this: protected void btnUpload_Click(object sender, EventArgs e) { // Upload the files to the server } On the page where the user control is present, after the user clicks on the upload button I want to perform some operation right after the b...

Pass WPF Button Command through UserControl

Hi, I've created a WPF UserControl which contains a Button. I now want any consumer of the usercontrol to be able to set a Command property on the usercontrol, and for that command to be assigned to the button within the control. i.e. so that when the button is clicked, it runs the command (in this case a Prism DelegateCommand). So, m...

Proper way to override Control.ControlCollection

I went about creating a custom TabControl widget so that I could accurately paint the tab with a close X on the right edge of the tab. I have a custom array class that holds all of the tabs. So I override the CreateControlsInstance instance class and redefine the Controls class so I can hide it during reflection serialization. prote...

ASP.NET User Control : can't initialize a user control property using Eval("...")

I designed a user control. It contains a public property "CurrentValue". When I try to initialize the property using an Eval expression, a null value is assigned. // In below code, label assignment is OK, RatingNull user control assignment get null <asp:TemplateField> <ItemTemplate> <asp:Label ID="Label1" runat="server" Te...

How to raise events to page from Dynamically loaded user control?

Hi, I have user control that inherits a base control class and these user controls are loaded using the LoadControl method, I can't seem to figure out how to raise events from user controls to the page that are dynamically loaded this way. Thanks Here is the delegate and event in the base user control class. public delegate void Som...

How to change Web User Control to Web control library

I just browsed and tried to find a good example changing a web user control(ascx) to a web control library. I used some javascript, Css and images for the control and i need this fiels to be build to my web control library. The answer I get it is not sufficient. ...

Setting and displaying a property in a WPF UserControl

Am i missing something here? I have created a usercontrol with a property and for arguments sake it has a text box in it. <UserControl x:Class="Isd.Utility.SystemMonitorWpf.Bar" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <TextBlock x:Name="txtExpected" G...

name 'html' nor name 'model' exist in current context in usercontrol MVC and C#

I am using Microsoft MVC and C#. I have a usercontrol (example.ascx) created and at the top I'm inheriting System.Web.MVC.ViewUserControl<PostTransferViewModel> Now, while my model name is appended to ViewUserControl, I get "The name 'Model' does not exist in the current context" and "The name 'Html' does not exist in the current contex...

mouse pointer and thumb nail for selection

What would be the appropriate way for selecting a particular row in a paginated view. For example, while trying to select a particular row in Yahoo Inbox you can use the pointer to select the check box and if you try to click beyond the check box, no action is taken. But while trying to select a particular row in GMail Inbox you can us...