usercontrols

How do you create a .NET winforms custom control that updates the designer?

I have created a custom user control like this (simple example): public class MyButton : Button { public MyButton() { BackColor = Color.Blue; } } After compiling, it shows up in the form designer toolbox, and is displayed with the updated property. But, if I change the color, the controls that I am already using o...

Binding two UserControls to the same DataContext, or ViewModel?

I am working on a UserControl, which is composed of a Chart panel and another area which manipulates some of the chart data i.e. the chart controls (change color of graph, enable or disable stuff on the chart, etc.). I use a ViewModel to manage the chart and its data, but was thinking maybe it would be nice to make a separate usercontro...

Finding the Location in the User Control.

I have one user control named XtraTreeList(It is combination of the treeview and datagridview) in which I want to get the location of the cell and nodes, but I can not find any property or method for that. Anyone have used it or any idea about that? Or can I use the graphics approach to find the location of the cell or nodes ? Like, thr...

Firing 1 usercontrol used for 3 different window at page load with different data

Hi Every one, Iam Divya working as developer. I had some issues. Hope there are many knowledged persons to solve my problem. We are following Model -View -View Model Pattern for WPF Window Project. I have an Window (contains only an XamData Grid) Which is complete User control. This User Control is used in 3 windows(Male Window, ...

Create a ControlTemplate that will trigger on Certain values of their DependancyProperties

I want to create a ControlTemplate that will trigger on vertain values of their DependancyProperties for example a different image appear on a button Anyway there are reasons why I need DependancyProperties This is a sample of what could be in my user control .. I have just shown a simple example of an effect triggered by a property cha...

Add bound DependancyProperty to button to control image displayed

Here is a simplification of the problem I want a Button with an extra DependancyProperty that I can bind to. The value of this property will control which image is selcted on the button. Question 2 is do I create a UserControl and draw the button on. If so how do I can use triggers to manage the image BUT I do not know how to do the T...

Date Time Picker Functionality with user input interface changed. WINFORM

I want to use date time picker for my window application. I am using Min Date Max Date property in my code. But user interface for inputing date is very complex for the purpose of accounting where we need faster typing speed and no or very less use of mouse. I want to modify a user interface for date time picker such that user need to ...

ASP.NET ListView with identical markup in EditItemTemplate and InsertItemTemplate

I have a ListView that includes an EditItemTemplate and an InsertItemTemplate. The two forms share almost all of their markup. For example: <asp:listview runat="server" ... > <layouttemplate>...</layouttemplate> <itemtemplate> <p><%#Eval("Name")%></p> <p><%#Eval("Title")%></p> ... </itemtemplate> <insertit...

Wpf User Control scale problem

I have a user control that has 5 rectangle shapes in it. I would like to be able to change the size of this control when I use it, but the rectangles don't scale with the control when I put it in the designer and resize it there, they just get covered up or don't expand. This seems like it should be very simple but it's eluding me. <Us...

Dataset manually put into the viewstate of a Web UserControl not kept after postback

I've created a Web User Control that is placed on the page at design time. It's purpose is to pop up with a grid of items the user is to choose from. So I've got a gridview on it. And this code in the usercontrol: Public Property DataTable() As Data.DataTable Get If Not IsNothing(ViewState("_SelectGridDataTable")) The...

ASP.Net User Control Event Bubbling (C#)

Many thanks in advance. I've done my due diligence and researched for 2 days, but can't seem to wrap my mind around what online tutorials describe. The situation: Lead Programmer ups and quits. Owner of firm knows I've done some (novice) VB.NET on the side and asks me to wire up functionality between 2 custom user controls on his intr...

WPF animation: binding to the "To" attribute of storyboard animation.

Hi, I'm trying to create a button that behaves similarly to the "slide" button on the iPhone. I have an animation that adjusts the position and width of the button, but I want these values to be based on the text used in the control. Currently, they're hardcoded. Here's my working XAML, so far: <CheckBox x:Class="Smt.Controls.Slide...

C# user controls custom events

Is there a way to give a User Control custom events, and invoke the event on a event within the user control. (I'm not sure if invoke is the correct term) public partial class Sample: UserControl { public Sample() { InitializeComponent(); } private void TextBox_Validated(object sender, EventArgs e) { ...

Displaying data conditionally within a user control

Within an ASP.NET user control I have the line: <div>Web: <a href="<%# Eval("Web") %>"><%# Eval("Web") %></a></div> I'd like to change it so this HTML is only rendered if Web has a value. I've tried wrapping String.IsNullOrEmpty(Eval("Web") as string) in server side script but Eval can only be used inside a "binding" tag. What is th...

ASP.Net Themes, UserControls and CSS

I'm building a Web application with rougly 30 pages, 12 user controls and 3 masterpages. I've centralized all the CSS in a Theme called Default. The application will expand in the near future. What is a best practice in separating css files? Should I: A - Put everything in one big CSS file separated by comment sections (every page ha...

Use OutputCache Directive with Themed Usercontrol

Is there a way to use output caching with a user control that is themed? Whenever I add the directive to my usercontrol I get this parser error: The 'ID' property of a control type ASP.controls_hotcontent_ascx cannot be applied through a control skin. The Error-source shows the skin-file for the usercontrol. Here's the directive ...

Convert Form to UserControl

I have a 3rd party code library that I'm using; part of this library is a winforms application for editing the configuration files used by this library. I would like to embed their configuration editor app into my application. I have the source code to their library and the configuration editor is (as far as I can tell) a straight forwa...

Opening a winform from a user control and passing back values to the usercontrol

Hi all I was wondering if it is possible to have a user control open a winform that allows a user to select options on it and then when he closes the form - the options / values he selected are returned to the user control? ...

display progress bar user control asp.net

Hi, I have a user control(.ascx page)...which is a progress bar...it has no code in "code behind". Instead a javascript function in .ascx page...which will display a progress bar. I need to display this progress bar(user control) only when user click a button. But the issue is ..it is getting displayed at the starting itself..that is on...

NullReferenceException after turning ascx UserControl into reusable server control using Microsoft's tips

A supposedly proven technique to turn UserControls of a website into reusable server controls while retaining the ability to use declarative code gives me a NullReferenceException on any reference of any control that's declared inside the ASCX code. When calling the ASCX from the same project, this problem does not occur. The idea is t...