usercontrols

Winforms Usercontrol: Perfomance issues when creating and adding to parent.

Hi there, I have built a UserControl for display a list of other UserControls which themselves are bound to individual data objects. The link below shows an example implementation of this control. Each of the individual user rows is its own UserControl/XtraUserControl, laid out in a FlowLayoutPanel. The problem I have is with perfo...

WPF User Controls and DataBinding

Hi all, I guess I'm a bit stuck on the mechanism of WPF DataBinding. Up to now I've thought of it as this : Any target of a DataBinding has to be a DependencyProperty.Keeping that in mind, I designed a very simple button-based UserControl like the following (boiled down to the most necessary parts): XAML <Button x:Class="MyNamespace.I...

Delete / Kill / Remove UserControl and its events handlers

Hello, I dynamically create UserControls using Reflection: UserControl myConmtrol = (UserControl)Activator.CreateInstance(t); The UserControl may handle a Closing event but I do not know the name of the handler. When the Window hosting the UserControl closes I remove the UserControl from its parent Window and it disappears from the Wi...

Silverlight UserControl and his own Viewmodel hosted in a View

I want to make a reusable UserControl as: A VIEW with its own VIEWMODEL where is the logic data recovery This UserControl (or View ?) has a button 'OK' to target a RELAYCOMMAND in his viewmodel I'm hosting this 'UserControl' in another VIEW ('MainPage'), who, herself, has its viewmodel My question is: How can I target the p...

How to retrieve a value from jquery in C# user control?

I have a visitorID variable in ToDo function in external javascript. I want to assign its' value in a user control. Front End Code: <asp:HiddenField ID="hidVisitorID" runat="server" Value="-1"/> <script type="text/javascript"> $j('#<%= hidVisitorID.ClientID %>').val(ToDo.visitorID); </script> In the back end it says, that hidVisit...

How to call UserControl javascript when parent page submits to server?

Hi I have an asp.net usercontrol located on on my aspx page. In the usercontrol there is a javascript function that I would like to fire everytime the page that contains the usercontrol submits to the server. (directly before this happens) Ideally I prefer to not have to write any code in the parent to make this happen, but I am not sur...

UserControl and binding paths--is it magic or logic?

I'm trying to confirm a binding behavior I believe I have observed, but I'm not exactly sure of. My original understanding was that a UserControl was sort of a black box, where if you wanted to share information back and forth with the controls contained within, you had to (1) use the DataContext or (2) define them on the surface of the...

Is there a client side event that occurs on a user control when its parent submits to the server?

Is there a client side event that occurs on a user control when its parent submits to the server? ...

How to hide the inner controls of a UserControl in the Designer?

I have a UserControl that contains a DropDownList and an ObjectDataSource. That control is used in the markup of my MasterPage. In the Designer of a ContentPage that uses that MasterPage I can see the DropDownList and the ObjectDataSource. See for yourself. I know that other controls (like ComponentArt:Grid) only show themself as oute...

Caching a server side user control in asp.net

Hi, My asp.net app is heavily using user controls and is high load; my concern is that loading user controls for every request (Page.LoadControl(controlPath)) is sub-optimal at best. I was thinking of caching an instance of loaded user control in HttpRuntime, but I don't know how's it going to behave when multiple connections (threads) ...

How to implement a custom panel with INamingContainer?

I'm trying to implement a custom panel control that would act as a naming container. So far here is so what I've done. First this is my custom control, MyPanel... [ToolboxData("<{0}:MyPanel runat=server></{0}:MyPanel>")] public class MyPanel: Panel, INamingContainer { } And I try using it like so: <cc1:MyPanel ID="A" runat="server">...

Where does a user-control go when the visibility of it is set to false?

Curiosity is kicking out again. I've been using the user control .Visible and .Hide() method for a long time. So where does a user-control go when the visibility of it is set to false? ...

Accessing resource from server component in ASP .NET

I'm a beginner in the black art of ASP .NET development, so forgive me if this is a stupid question. After a bit of googling, and reading though (some of...) ASP .NET 3.5 Unleashed, I've yet to find a way of doing what I want - which usually either means I'm trying to do something stupid, or it's so obvious I've missed it :) I'm creati...

User control button click event

I am using an user control which have a button named 'btn_Save'.I need to fire an email on clicking the user control 'btn_Save' button. But I have do this from my aspx code behind page.So, How can I do this in code behind page using C#. ...

Finding html element onPreRender state of User Control

Hi all, I have a user control which has html elements like <input type="button".... and i want to set its display property on preRender state. Would you please explain, what kind things i have to handle this user control? So, in this function protected override void OnPreRender(EventArgs e) { } I have only EventArgs e and it doesn't ha...

User Control - Generic List Bindable Property

Hey SO, I am trying to create a User Control that accepts a generic List of CustomObject as a bindable property. I've hit a wall and can't figure it out. Any help would be greatly appreciated! I'd like it to look a little somthing like this : TabularReport.ascx [Bindable (true)] public IList<T> Source { get; set; ...

dynamic binding of rows and columns to a grid in WPF

With a DataGrid object in WPF, we can bind its rows to an observable collection such that as rows are added or removed to/from the collection, the UI updates to display the changes. I am looking to do something similar with a Grid control as part of a User Control I am trying to create. Is this possible? ...

ASP.NET - How can I add a new javascript from a user control loaded by callback?

Hi all, I'm doing a menu that loads levels dynamicly, when you click on a item the next level is loaded asynchronously. For each menu item I have a user control. Every user control is declared in its parent, for example, the "secondlevelcontrol" has the reference to "thirdlevelcontrol". With this level of nesting, I want to manage the ...

xml-like properties in a user control declaration

Hello I've created a user control that takes content from an XML file and renders the content on the page. Fairly straight-forward stuff. However it's come up that I may need to replace portions of the content based on id with other manual content. My idea is to expose a repeatable property within the user control's declaration like t...

Create a TextBox similar to MS Outlook email recipient TextBox

Hello, I want create a UserControl that is similar to the MS Outlook 2010 recipient TextBox. As I have never done something similar before I would need some good input/ideas how to achieve that. Just some guidance that I can walk along the route... My requirements are this: Enter the name of a guest like "Ro...." and I got suggested ...