usercontrols

Substitution Control at the User Control Level?

I am trying to create some cached user controls. Basically Header and Footer are static. Except the footer has one link that reads in the url of the page and puts it into the javascript for sending a link to a friend. So I need that link to be dynamic. I set up a substitution control and had the static method return the dynamic link...

WebBrowserControl Scroll to Bottom

I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display the messages between the user and the recipient. How do I get the control to automatically scroll to the bottom every time I update the DocumentText of the control? ...

Do you know any WPF based text editor control?

Note that I'm not looking for something based on TextBox or RichTextBox. What I'm interested in is a text editing control written from scratch using WPF typography features. Open source would be a plus. ...

UserControl Property of type Enum displays in designer as bool or not at all

I have a usercontrol that has several public properties. These properties automatically show up in the properties window of the VS2005 designer under the "Misc" category. Except two of the properties which are enumerations don't show up correctly. The first on uses the following enum: public enum VerticalControlAlign { Center, ...

"Could not reformat the document" in ASP.NET, VS2008

I'm in an ASP.NET UserControl. When I type Control-K, Control-D to reformat all the markup, I get a series of messages from VS 2008: "Could not reformat the document. The original format was restored." "Could not complete the action." "The operation could not be completed. The parameter is incorrect." Anybody know what causes this...

Expose DependencyProperty

When developing WPF UserControls, what is the best way to expose a DependencyProperty of a child control as a DependencyProperty of the UserControl? The following example shows how I would currently expose the Text property of a TextBox inside a UserControl. Surely there is a better / simpler way to accomplish this? <UserControl x:Clas...

Anyone have sample code for a UserControl with pager controls to be used in a GridView's PagerTemplate?

I've got several Gridviews in my application in which I use a custom PagerTemplate. I'd like to turn this custom template into a UserControl so that I don't need to replicate the same logic in multiple pages. I'm pretty sure that such a thing is possible, but I'm unsure of how exactly to wire the UserControl to the Gridview's events, and...

What's the best method to enable or disable a feature in a .net desktop application

It can be either at compile time or at run-time using a config file. Is there a more elegant way than simple (and many) if statements? I am targeting especially sets of UI controls that comes for a particular feature. ...

How to dynamically generate combination of ASP.NET user controls?

I have several user controls, let's say A, B, C and D. Based on some random input, I need to generate a combination of these. For e.g. if input is 2a3d1a2c I need to show two of the A's, 3 D's after that, an A again, etc. I will also need to stabilize clientid's in order for them to work correctly. Because each of these controls use the...

Best way to validate drag/drop operations for a TreeView in C#

I want to verify a drag & drop operation is allowed. A valid item can come from another one of our "controls", or internally from within the custom treeview. Currently I have this: bool CanDrop(DragEventArgs e) { bool allow = false; Point point = tree.PointToClient(new Point(e.X, e.Y)); TreeNode target = tree.GetNodeAt(point...

User Control created dynamically not able to handle events on PostBack

I have a user control which is loaded in the page dynamically using the following code in Init of the Page. Dim oCtl As Object oCtl = LoadControl("~/Controls/UserControl1.ascx") oCtl.Id = "UserControl11" PlaceHolder1.Controls.Clear() PlaceHolder1.Controls.Add(oCtl) The user control also contains a button and I am unable to capture th...

Baseline snaplines in custom Winforms controls

I have a custom user control with a textbox on it and I'd like to expose the baseline (of the text in the textbox) snapline outside of the custom control. I know that you create a designer (inherited from ControlDesigner) and override SnapLines to get access to the snaplines, but I'm wondering how to get the text baseline of a control t...

what is the best way to display a 'loading' indicator on a WPF control

In C#.Net WPF During UserControl.Load -> What is the best way of showing a whirling circle / 'Loading' Indicator on the UserControl until it has finished gathering data and rendering it's contents? ...

Options for Dynamic content in ASP.Net

What choices do I have for creating stateful dynamic content in an ASP.Net web site? Here's my scenario. I have a site that has multiple, nested content regions. The top level are actions tied to a functional area "Catalog", "Subscriptions", "Settings". When you click on the functional action, I want to dynamically add content specif...

[ASP.NET] Controls do not appear on dynamically created user control

I have user control named DateTimeUC which has two textboxes on its markup: <asp:TextBox ID="dateTextBox" runat="server"></asp:TextBox> <asp:TextBox ID="timeTextBox" runat="server"></asp:TextBox> I am dynamically creating this control in another user control: Controls.Add(GenerateDateTime(parameter)); private DateTimeUC GenerateDateT...

Best way to register js for modularity in User Control

Hello i have a control that is organized like this and i want to have the javascript registered on the calling master pages, etc, so that anywhere this control folder is dropped and then registered, it will know how to find the URL to the js. Here is what i have so far (in the user control ) protected void Page_Load(object sender, ...

update page text using web user control

I am building an application where a page will load user controls (x.ascx) dynamically based on query string. I have a validation summary on the page and want to update it from the User Controls. This will allow me to have multiple controls using one Validation Summary. How can I pass data between controls and pages. I know I can def...

Design Time viewing for User Control events

I've create a WinForms control that inherits from System.Windows.Forms.UserControl...I've got some custom events on the control that I would like the consumer of my control to be able to see. I'm unable to actually get my events to show up in the Events tab of the Properties window during design time. This means the only way to assign th...

Windows Forms UserControl overrides not being called

I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in this link. public ref class CTiledImgViewControl : public UserControl { ... virtual void OnPaint( PaintEventArgs^ e ) override; ... }; And in my CPP file: void CTiledImgViewControl::OnPaint( ...

MVC User Controls + ViewData

Hi im new to MVC and I've fished around with no luck on how to build MVC User Controls that have ViewData returned to them. I was hoping someone would post a step by step solution on how to approach this problem. If you could make your solution very detailed that would help out greatly. Sorry for being so discrete with my question, I wo...