usercontrols

WPF: Loading data in the constructor of a UserControl breaks the Designer

I have a main window with a usercontrol. When adding code in the default constructor of the usercontrol, the designer stops showing the main window. It gives a message: Problem loading The document contains errors that must be fixed before the designer can be loaded. Reload the designer after you have fixed the errors. ...

Can you build ASP.net User controls as assemblies?

Is there some setting in VS2K8 or some command line utility that can compile my user controls as .net assemblies? Is it even possible? ...

C# Scaling UserControl content to match users Dpi/Font Size

How do I get my OwnerDrawn UserControl to respect the users dpi (96/120/xxx) and/or font-size (normal, large, extra large)? Some people suggest to use the DpiX and DpiY properties on a Graphics object, but that doesn't seem to to anything in my control (i.e. they are always set to 96, regardless of which font-size or dpi I choose). The...

User Controls in Repeater

I have a usercontrol that provides voting buttons (for a SO type voting model) - it contains a private int member that retains the id of the record. Outside a repeater, it functions just fine - postbacks work, and the correct id is retained in the user control. Inside the repeater, an itemdatabound event handler associates the correct ...

C# GUI control for editing a Dictionary

Is there a standard control that lets a user edit the key-value pairs of a String to String Dictionary? If not, how would you implement one? I've got a few ideas but none of them seems great. ...

Themable User Controls in WPF

How can I create a UserControl in WPF that has a basic default style but can also easily themed when needed? Do you have some good guidelines, blog entries or example that explain this specific topic? Thank you in advance, Marco ...

Programmatically added User Control does not create its child controls

I have a user control (.ascx) in my project that I am adding to a page programmatically in the page's Page_Load event handler, like so: Controls.Add(new MyProject.Controls.ControlWidget()); Databind(); When I try to access the control's child controls from within the control itself, they do not exist. public override void DataBind()...

only one usercontrol instance specified in datatemplate

I have specified a userControl as a dataTemplate. <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=Pages}"> <TabControl.ContentTemplate> <DataTemplate> <uc:ItemTemplateControl /> </DataTemplate> </TabControl.ContentTemplate> </TabControl> The userControl is very easy and just binds...

ASP.NET AJAX issues when using UserControls

Hi Stackoverflowers I Have a UserControl called TenantList.ascx which contains a slightly modified GridView from DevExpress (Web.ASPxGridView). This control makes Callbacks without causing a postback which is exactly what I need. The specific event I need to react on is CustomButtonClicked. I have made my on OnCustomButtonClicked event ...

Datalist placed inside a usercontol problem

Hi,I have a usercontrol.Inside usercontrol I have a datalist and sqldatasource.Sqldatasource needs a parameter to databind the datalist.Usercontrol gets a paramter by this way, private string _urunIDparam; public string urunIDparam { get { return _urunIDparam; } set {_urunIDparam = value; } } And then thi...

UpdatePanel in Repeater

I have a UserControl which contains voting buttons inside an UpdatePanel, and outside a Repeater, it works perfectly. In the repeater, clicking the button fires off the appropriate event. That event is supposed to update the text of a control within the User Control, and that update should be reflected when the UpdatePanel refreshes. If...

Need to create a custom wizard control.

I have been asked to build a custom wizard control in VB.NET for a windows forms project. It has been made very clear to me that I am not "allowed" to utilize existing wizard controls on the internet due to some obscure logic surrounding copyrights. It has also been made clear to me that we are not "allowed" to use usercontrols in the ...

ASP.NET: Best practice for binding Usercontrols inside a formview

Hello, I need to edit a complex object with complex properties using a web form. For example, editing a "User Information" record that contains all kinds of information about a user, including complex things like a unique tree for each user. What I did was this: I created a web form with a Formview control, and set the object I want to...

struggling with programmatically adding user controls

I have the same problem as in the question Programmatically added User Control does not create its child controls. After reading the question and answer I changed my code which now looks like this: foreach (ITask task in tasks) { TaskListItem taskListItem = LoadControl( typeof(TaskListItem), new object[] {task} ...

How can page events be handled from a usercontrol? (VB.net)

I would like some code to execute at the "preload" stage of my usercontrol's lifecycle. However the preload event is only available on the Page object. So, I added the following method to my usercontrol: Private Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Page.PreLoad However, I know get the compile...

How to display text string in user control at design time?

I am creating a user control that contains a panel as well as 4 string and integer properties. I would like to display the text of the properties in the user control during design time. How do I do this? I am having a hard time finding examples. ...

ASP.NET UserControl Inheritence

I have a UserControl that is working fine. It is declared like this. public partial class DynamicList : System.Web.UI.UserControl { protected static BaseListController m_GenericListController = null; public DynamicList() { m_GenericListController = new GenericListController(this); } } Now I...

Super slow C# custom control

Hi everyone I've made a custom control, it's a FlowLayoutPanel, into which I put a bunch of other custom controls (just Buttons, each with three Labels and a PictureBox overlayed) It works ok with around 100 buttons, but bump that up to 1000 and it's in trouble. Bump that up to 5000 and it just dies after 20 seconds. I have very littl...

Stack overflow when setting MasterPage properties

I'm getting a stack overflow when tryin to set a public property in a MasterPage from an ASPX page. I'm making a "greeting card" editor, using a TabContainer. Each tab has a user control, and everything is updated when active tab is changed - while doing so I need to store all the data away in master page properties. From the ASPX pag...

injection user control depending on radio button choice (ASP.NET MVC)

I have this Create Event form (asp.net mvc), and i have to change some parts of the form, depending on user's choice. When the user clicks radio buttons, different user controls (ascx files) should be injected inside the form hopefully using Ajax. Any suggestions to do this? ...