usercontrols

set focus to user control, and blur base page

Hi, I have a progress bar (which is a user control). When user, click a button, this progressbar will get displayed. The issue is ...even if the progressbar is visible, I am able to set focus to other controls in base page. I need to blur the base page...and set focus to user control. Plz help me ...Thanks in advance...! ...

Asp.Net Add UserControl to a Page

I have an ASP.Net web site and on one of the pages I'm using a repeater to render several iterations of a UserControl, that UserControl contains a second UserContol that has two text boxes that my User must enter information into. I want to be able to have my user push a button and add another instance of the second UserControl (with th...

ASP.NET Not display user control C#

Say I have a user control (.ascx) on a .aspx page. In the code behind on the .ascx is there a way to tell itself to not load if a certain condition was met? I don't want to just not display this control by javascript or css, I need to do it in the codebehind. Any thoughts? ...

Reflection in a UserControl to examine containing form. C#

my project is written in c#. I have a usercontrol that I've designed. In that usercontrol I want the ability to look through the form the control is placed on using reflection to look at all other controls on the form. How can I go about doing this? I've used reflection to go through dll's but not for something like this. in summary: M...

Why can't I reset the Background of the TextBox in my UserControl?

I've built a UserControl that extends the functionality of the ComboBox in interesting and useful ways. It looks like this when it's dropped down: I've built a whole bunch of features into the control and they all work smoothly. This leads me to believe that I have something of a clue as to what I'm doing. You'd think it would be a...

user control in asp.net with ajax functionality is possible

how to create user control in the asp.net please give me example of it and can we keep ajax's accordin in user control or not?? ...

Exposing a complex property in an ASP.NET user control

I would like to expose a complex property from a custom ASP.NET user control, in such a way that it can be set from the control tag in the aspx page. Something like this: public class TestData { public int X; public int Y; } public partial class TestControl : System.Web.UI.UserControl { public TestData TestProperty { ...

Viewstate variable lost on user control loaded dynamically.

Hello. I have a problem with ViewState. I have an aspx page that has a treeview on the left and an UpdatePanel with an ASP.NET Panel inside on the right. It is in that inner Panel where I load and unload dynamically user controls. I use that update panel to load dynamically controls. I also made a custom control for my user controls be...

Access child user control's property in parent user control

I have included a user control in another statically following code : place the folowing directive in the asp code of the parent page or usercontrol: <%@ Register src="Name_of_your_child_control.ascx" tagname="Name_of_your_child_control" tagprefix="uc1" %> use the following tag in the asp-code of the parent page/control: <uc1:Name_...

Selecting item in incapsulated DropDownList on DataBind

I have a complex UserControl with the main purpose to encapsulate DropDownList with a number of properties for advanced manipulation. List is being populated on PreRender event depending on properties previously were set: protected void Page_PreRender(object sender, EventArgs e) { sourceClient.SelectCommand = this.Property1 ? "exec...

WPF share column width between separate grids

I have the following setup on my WPF UserControl: <GroupBox> <Grid> ... <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <GroupBox> <Grid> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="..." /> I'd like the second ColumnDefinition to be the same width as the first...

WPF Databinding a User Control

I have a user control, A, which wraps a third-party date-picker control, DP. A tells DP's SelectedDate dependency property to two-way bind to A's SelectedDate dependency property, thus effectively exposing the wrapped date-picker's SelectedDate value. I then have a control X which contains an instance of user control A. This tells A's...

Checkboxes in usercontrol won't check although they say they are...

Hi I have a simple usercontrol, with a datalist, and checkboxes inside. <asp:DataList ID="DataListDroits" runat="server" DataKeyField="droit_id" DataSourceID="SqlDroits"> <ItemTemplate> <asp:HiddenField ID="HiddenFieldDroitID" runat="server" Value='<%# Eval("droit_id") %>' /> <asp:CheckBox ID="CheckBoxDroit...

Any disadvantage to using an ElementHost to host a WPF UserControl in a Winform application?

Curious if there are any disadvantages to using an ElementHost to host a WPF UserControl in a Winform application? I ask because in general I feel that it takes to much time for me create a new WPF application with a basic interface that looks decent. Decent in the sense that if I create a new Winforms application and throw some control...

Does 1 ViewModel really have 1 View?

Hello, its said that 1 ViewModel has 1 View. 1 View is for me a UserControl. What if my UserControl has different areas filled with data from different entities, do I have then several Views and need to build several ViewModels? e.g: I display in a UserControl 3 entities: customer(listbox),order(datagrid),product(datagrid). Each of th...

ASP.NET Custom user control to add dynamically

I have hard time to modify a page that had a Custom User Control directly to the ASPX page and now require to have it dynamically loaded when needed only. The User Control does have html and other controls via the ASCX file and has code in the code-behind. I have read multiple page and have found that I cannot instantiate directly the U...

How can one scroll legitimately with GDI+?

Is there a preferred, fast method of scrolling within a user control in GDI+? I've created a control that graphically renders a horizontally scrollable data plot. Currently, my control operates by converting the position of a horizontal scroll bar into an offset into the data. The control then renders the data that exists between this...

wpf: design time error while writing Nested type in xaml

I have created a usercontrol which accept type of enum and assign the values of that enum to a ComboBox control in that usercontrol. Very Simple. I am using this user control in DataTemplates. Problem comes when there comes nested type. I assign that using this notation EnumType="{x:Type myNamespace:ParentType + NestedType}" It wor...

SharePoint Custom Module Development and Deployment

Good Day, We're working on custom module (Information Management System) for SharePoint. The project file of this module is a Class Library which contains User Controls. The User Controls was based upon SmartPart and AJAX Extension Toolkit. The module has a separate database which has tables/views/stored procedure. On development envir...

Setting up binding to a custom DependencyProperty inside a WPF user control

I have a WPF UserControl containing a custom DependencyProperty named MyDP. I want to bind this to a property on my ViewModel (which is injected as the UserControl's DataContext). I know one way to do it by setting the binding in the UserControl's declaration in the parent window's XAML as such: <Window x:Class="MyNamespace.Views.Main...