usercontrols

Listview inside UserControl raises full postback

I have UserControl and within that control i have asp:ListView. Inside the ListView i have a asp:LinkButton. When i click on the LinkButton the control raises full postback, no matter if the UserControl is inside UpdatePanel or is not. UserControl: <asp:ListView ID="lvImages" runat="server" OnItemCommand="lvImages_ItemCommand"> <I...

WP7 - Controls - Criteria to decide which class to inherit from - UserControl or ContentControl or Control class

Hi, I am developing controls for WP7 application. I am aware that I can quickly create control by inheriting from UserControl class (that derives from Control class). Also, that such controls cannot be customized, i.e., all the properties associated with control are those harcoded in user control - they cannot overridden in xaml etc. But...

Windows Form or WPF, to code or not code

I am planning to develop a UI control suite (open source) on .net because there is hardly such things as free or open source out in the market. But I am not really able to decide the following factors before going into design phase: Should I write it for Winforms only? Should I write it for WPF only? Or, should I write it for both? ...

Writing custom controls...

HI Guys, I'm interested writing a set of custom controls (most likely in ASP.NET), was wondering what sort of guidelines I should follow. - Is there any generic requirements for UI controls that should be followed? - When writing documentation / samples etc, any guidelines on what they should include? I know it's very general question bu...

Cannot update a treeview inside a usercontrol

I created a usercontrol with a treeview inside it. The treeview will be populated if I add nodes in the onload handler of the usercontrol. But after that(for example, I click a button in its parent form), the treeview will not refresh. I can see the nodes was updated in memory, but it just cannot display on the screen. I called refresh/u...

.NET imagebutton - does it require codebehind?

Hi, I've created a simple .NET usercontrol for logging into a members area on a website (the site is powered by Umbraco and uses their membership provider). It worked fine until I changed the submit button on the log-in usercontrol to an imagebutton. Now it doesn't seem to submit anything - it just reloads the page when clicked and do...

pass message from the parent window to child user control wpf

I have a window that is hosting a user control. I wish to pass (raise) events in the parent window that should reach the user control. How do I define events in the parent window that the child user control can also receive. ...

How can I programmatically access elements defined in a ContentTemplate?

Hello all, Let's say I've created a UserControl with the following ContentTemplate defined in XAML: <UserControl.ContentTemplate> <DataTemplate> <Ellipse Name="myEllipse" Stroke="White"/> <ContentPresenter Content="{TemplateBinding Content}"/> </DataTemplate> </UserControl.ContentTemplate> How would I access ...

Setting the UserControl property to child controls - WPF, Sliverlight

I have a Usercontrol with a Button and TextBlock in it. I would like to set the Background of both Button and TextBlock with the Background of the Usercontrol.(ie, I am trying to Bind to the usercontrol's Background property). Please let me know how can I do this in XAML. Is there any difference for this in Silverlight and WPF? ...

Unable to call an ASP.NET user control from another

I wish to access a user control's public property from another user control. But, I am not able to access one user control within another. Even after using the namespace 'ASP', I am only able to see the reference to the current user control. However, in a page I am able to refer to all the user controls with the ASP namespace. Am I mis...

UserControl is not reflecting changes in Visual Studio 2010

Anyone faced a problem while creating a UserControl in a library then drop it in a Form project...change this control's e.g. BackColor and rebuilding, changes are not reflecting in the Form project? EDITED: when updating the control e.g. change controls, drop new controls inside the control, updating is happening. Looks like the control...

Performance Impact of Adding Parameter to User Control

We run a site that uses master pages and creates its navigation using the built-in ASP.NET sitemap provider. The navigation presents itself as a CSS rollover menu. Our client would like to show the entire menu, including 2 levels of sub-menus, to one audience while restricting a different audience to a single level of navigation. My code...

Problems with UserControl and Inner Properties

I am trying to develop a control that'll allow the developer to populate a collection through markup (e.g. Properties decorated with the attribute PersistenceMode(PersistenceMode.InnerProperty). I have an example from Brian Chavez that more or less does what I want but I want to have the control inherit from UserControl and not Control....

GoToState does not work for ControlTemplate in UserControl

Hi, I am totally lost and I would really appreciate your help on this. My final goal is to create a user control that will contain two control templates. Square and a Circle. Based on a type the control will display one or the other. When the mouse enters the shape the Opacity will change to 0.2. The first part works but the Opacity do...

Defining path to executable for a custom control

I have created a custom control using VB.NET in Visual Studio 2008 that gives extensive mapping and tracking functionality to a search and rescue app. The problem I am having is that in a number of places I need to define the path to the main applications executable in order to find a number of directories the control needs to function ...

c# asp.net , add custom control

Heya folks, I've created a usercontrol in asp.net webforms (c#) called 'Article' which contains a general layout for an article and has a public property called datasource. the datasource will be populated by a subsonic (DAL) activerecord. In the controls pre-render event it will read the record and populates the labels. I think this is...

GoToState always returns false

Hi, I have created a user control with a control template (containing VisualStateGroups definition), and also have an accompanying c# class. ie Public Class MyClass: UserControl{......} I have hooked up the usercontrol mouse enter and mouse leave to go to their relative visual states....and this works. When i run the app, and mouse ...

.NET UserControl inherit parent form background

I have a WinForms control inherited from TreeView and I want it to automatically adjust background color according to the form (also customized) background. How to make it? ...

How to make UpdatePanel inside ListView work?

Hey, I have a page with a listview that shows something like posts. On each post there should be a "rate box" which works similar to the "Like" button in facebook. The rate box is a User Control, that has an update panel inside it. If I put the control with some random values in the page it works great - but when I put it inside the Li...

usercontrol default style

Hi I've created a user control like this: <UserControl.Resources> <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#F3F3F3" Offset="0"/> <GradientStop Color="#EBEBEB" Offset="0.5"/> <GradientStop Color="#DDDDDD" Offset="0.5"/> <GradientStop Color="#CDCDCD" Offset="1"/> ...