Search Results

Search found 6270 results on 251 pages for 'databound controls'.

Page 1/251 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How can I use Databound variables in conditional statements within Custom Databound controls?

    - by William Calleja
    I'm developing my custom DataBound Controls that make use of an '<ItemTemplate>' tag and '<%# %>' server tags to generate some data however I need to make a conditional statement within one of my Databound controls as shown below. <custom:DataboundControl runat="server"> <ItemTemplate> <% if(((Dictionary<string, string>)Container.DataItem)["MyVariable"]=="" { %> <!-- Conditional Code Happens Here --> <% } %> </ItemTemplate> </custom:DataboundControl> Right now my code isn't working because the compiler cannot recognize my Container.DataItem variable within a <% %> tag and a <%# %> tag doesn't support conditional statements. What can I use?

    Read the article

  • Reset the controls within asp placeholder

    - by alaa9jo
    I use placeholders very much in many projects,but in one of the projects I was asked to reset the controls within a specific placeholder to their original state after the user has finished from inserting his/her data. As everyone of us know,to keep the controls within a placeholder from disappearing after postbacks you have to recreate them,we add such a code in i.e. page_load,the controls will be recreated and their values will be loaded from viewstate (for some of them like textbox,checkboxs,..etc) automatically,that placeholder contains only textboxs so what I need is to block/ loading/clear that viewstate after inserting the data. First thought: Customizing placeholder I thought about it and tried overriding many methods but no success at all...maybe I'm missing something not sure. Second thought: recreate the controls 2 times: In page_load,I recreate the controls within that placeholder then in button click (the button that saves user's data) I recreate them once more and it worked! I just thought of sharing my experience in that case with everyone in case anyone needed it,any better suggestion(s) is welcomed.

    Read the article

  • foreach Control ctrl in SomePanel.Controls does not get all controls

    - by aron
    Hello, I have a panel with a bunch of labeles and textboxes inside of it. The code: foreach (Control ctrl in this.pnlSolutions.Controls) Seems to only be finding html table inside the panel and 2 liternals. But it does not get the textboxes that are in the html table. Is there a simple way to get all the controls inside of a panel regardless of the nesting? thanks!

    Read the article

  • ASP.Net validation controls

    - by nikolaosk
    In this post I would like to continue talking about validation in ASP.Net applications. I will look into the validation controls that ASP.Net provides. You can have a look at the first post in my blog regarding validation. You will show you that we can perform all our main validation tasks without almost writing any code. We will add validation to our form by adding one or more controls.We can also display messages to the user. The controls I am going to look into are: CompareValidator CustomValidator...(read more)

    Read the article

  • Unselect Databound Combobox Winforms .NET

    - by joedotnot
    The problem: combobox is databound to a DataView, first item in the dataview is DataRowView whose fields are DBNull.Value; Combo DropdownStyle = ComboBoxStyle.DropDownList Loads fine, displays fine, selects fine, problem is to Unselect via code. Setting the SelectedIndex to 0 throws an exception. (Setting to -1 is a no-no as per msdn doco that says dont set SelectedIndex=-1 if databound) So how to unselect without throwing an exception ? For now i wrapped it into a try/catch to just ignore the error! EDIT: As asked by Hubeza, i worked on sample code to post. Did a stripped down version of the original code in C# (original is in VB.NET) and could NOT reproduce it either. Converted to VB.NET and could NOT reproduce it either ! In other words, SelectedIndex = 0 does work in the stripped down version! Currently further investigating what else could be wrong with the original code. EDIT2: Case Closed. Call me a stupid fool if you like, and apologies for wasting anyone's time - The error was originating from MyComboBox_SelectedIndexChanged event, which i neglected to check ! May as well post the sample in case anyone finds useful. private void LoadComboMethod() { DataTable dtFruit = new DataTable("FruitTable"); //define columns DataColumn colID = new DataColumn(); colID.DataType = typeof(Int32); //VB.NET GetType(Int32) colID.ColumnName = "ID"; DataColumn colDesc = new DataColumn(); colDesc.DataType = typeof(String); colDesc.ColumnName = "Description"; //add columns to table dtFruit.Columns.AddRange(new DataColumn[] { colID, colDesc }); //add rows DataRow row = dtFruit.NewRow(); row[colID] = 1; row[colDesc] = "Apples"; dtFruit.Rows.Add(row); row = dtFruit.NewRow(); row[colID] = 1; row[colDesc] = "Bananas"; dtFruit.Rows.Add(row); row = dtFruit.NewRow(); row[colID] = 1; row[colDesc] = "Oranges"; dtFruit.Rows.Add(row); //add extra blank row. DataRowView drv = dtFruit.DefaultView.AddNew(); drv.EndEdit(); //Bind combo box DataView dv = new DataView(dtFruit); dv.Sort = "ID ASC"; //ensure blank item on top cboFruit.DataSource = dv; cboFruit.DisplayMember = "Description"; cboFruit.ValueMember = "ID"; } private void UnselectComboMethod() { if (cboFruit.SelectedIndex > 0) { cboFruit.SelectedIndex = 0; } else { MessageBox.Show("no fruit selected"); } }

    Read the article

  • User controls & Composite web server controls

    - by Shekhar_Pro
    Well Its both a poll and a question. Which approach should i prefer when it comes to writing a custom control in ASP.Net. Should i create a custom User control or should I create a Composite Web Server control. And how about adding a Designer support to the composite control. How are they different from each other and their Pros and Cons. Differentiating with an example of each will be preferable.

    Read the article

  • ASP.Net Form Databound problems

    - by Jason Bitman
    I know there is a similar problem on this forum, but the solutions did not really work for me. I am populating form controls with fields from a few different data sources, and the data shows up great. I have an ImageButton controlwhich has an OnClick Event set to grab all of the data from the form. Unfortunately, when I click the button, it seems as though the page is reloading first, and THEN is executes the OnClick call. The data that was hand-entered, or hard-coded seems to be pulled fine from the controls it was entered in, but anything that was pulled from a datasource is not able to be read. Any ideas. this is the last hurdle in a project that I have been working on for 6 months. I want to go home... Thank you so much in advance. Jason

    Read the article

  • WPF Databound RadioButton ListBox

    - by Mark
    I am having problems getting a databound radiobutton listbox in WPF to respond to user input and reflect changes to the data it's bound to (i.e., to making changes in the code). The user input side works fine (i.e., I can select a radiobutton and the list behaves as expected). But every attempt to change the selection in code fails. Silently (i.e., no exception). Here's the relevant section of the XAML (I think): <Setter Property="ItemContainerStyle"> <Setter.Value> <Style TargetType="{x:Type ListBoxItem}" > <Setter Property="Margin" Value="2" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <Border Name="theBorder" Background="Transparent"> <RadioButton Focusable="False" IsHitTestVisible="False" IsChecked="{Binding Path=IsSelected, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" > <ContentPresenter /> </RadioButton> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </Setter.Value> I bind the listbox to a List of SchoolInfo objects. SchoolInfo contains a property called IsSelected: public bool IsSelected { get { return isSelected; } set { if( value != isSelected ) { isSelected = value; this.OnPropertyChanged("IsSelected"); } } } The OnPropertyChanged() stuff was something I put in during my experimentation. It doesn't solve the problem. Things like the following fail: ((SchoolInfo) lbxSchool.Items[1]).IsSelected = true; lbxSchool.SelectedIndex = 1; They fail silently -- no exception is thrown, but the UI doesn't show the item being selected. Mark

    Read the article

  • Adding & Removing Dynamic Controls in C# WinForms.

    - by gsvirdi
    I have three Tabs in my WinForm; depending on the selected RaioButton in the TabPages[0] I added few dynamic controls on the relevant TabPage. On Button_Click event the controls are added, but the prob is the I'm not able to remove the Dynamically added controls from the other (irrelevant) TabPage. Here's my code: Label label235 = new Label(); TextBox tbMax = new TextBox(); label235.Name = "label235"; tbMax.Name = "txtBoxNoiseMax"; label235.Text = "Noise"; tbMax.ReadOnly = true; label235.ForeColor = System.Drawing.Color.Blue; tbMax.BackColor = System.Drawing.Color.White; label235.Size = new Size(74, 13); tbMax.Size = new Size(85, 20); if (radioButton1.Checked) { label235.Location = new Point(8, 476); tbMax.Location = new Point(138, 473); tabControl.TabPages[1].Controls.Add(label235); tabControl.TabPages[1].Controls.Add(tbMax); tabControl.TabPages[2].Controls.RemoveByKey("label235"); tabControl.TabPages[2].Controls.RemoveByKey("tbMax"); } else { label235.Location = new Point(8, 538); tbMax.Location = new Point(138, 535); tabControl.TabPages[1].Controls.RemoveByKey("label235"); tabControl.TabPages[1].Controls.RemoveByKey("tbMax"); tabControl.TabPages[2].Controls.Add(label235); tabControl.TabPages[2].Controls.Add(tbMax); } Where am I making that mistake?????

    Read the article

  • Can't find controls in FormView.InsertItemTemplate even on DataBound event

    - by abatishchev
    I have FormView in my page markup: <asp:FormView ruanat="server" ID="FormView1" OnDataBound="FormView1_DataBound" DataSourceID="SqlDataSource1"> <InsertItemTemplate> <uc:UserControl1 runat="server" ID="ucUserControl1" /> </InsertItemTemplate> </asp:FormView> <asp:SqlDataSource runat="server" ID="SqlDataSource1" SelectCommand="EXEC someSP" /> It's code-behind: protected void FormView1_DataBound (object sender, EventArgs e) { var c1 = ((FormView)sender).FindControl("ucUserControl1"); // returns null var c2 = FormView1.FindControl("ucUserControl1"); // also returns null } In theory, I'm able to find control on FormView after it being data bound. But I'm not. Why?

    Read the article

  • WPF Databound Listbox

    - by Jeff
    I have a listbox bound to a list of objects for a data entry screen. The item template includes textblocks, a checkbox and comboboxes. When the listbox is populated I would like to change the foreground color of the textblocks to red if object.value1 = true and object.value2 = 0. Any ideas?

    Read the article

  • .net databound lists

    - by d daly
    Hi, Is there any way around this? I have a few dropdown lists bound to lookup tables in sql server. some old records imported from a previos version of the system wont open due to data in these fields not matching the current dropdown data. Other than adding the old data to the lookup table (which I dont want to do) is there a way around this? Thanks DD

    Read the article

  • Web 2.0 Extension for ASP.NET

    - by Visual WebGui
    ASP.NET is now much extended to support line of business and data centric applications, providing Web 2.0 rich user interfaces within a native web environment. New capabilities allowed by the Visual WebGui extension turn Visual Studio into a rapid development tool for the web, leveraging the wide set of ASP.NET web infrastructures runtime and extending its paradigms to support highly interactive applications. Taking advantage of the ASP.NET infrastructures Using the native ASP.NET ISAPI filter: aspnet_isapi...(read more)

    Read the article

  • Need to replace 3rd party WinForm controls, what's the closet WPF equivalent?

    - by Refracted Paladin
    I am tired of Windows Forms...I just am. I am not trying to start a debate on it I am just bored with it. Unfortunately we have become dependent on 4 controls in DevExpress XtraEditors. I have had nothing but difficulties with them and I want to move on. What I need now is what the closet replacement would be for the 4 controls I am using. Here they are: LookUpEdit - this is a dropdown that filters the dropdown list as you type. MemoExEdit - this is a textbox that 'pops up' a bigger area when it has focus CheckedComboBoxEdit - this is a dropdown of checkboxes. CheckedListBoxControl - this is a nicely columned list box of checkboxes This is a LOB app that has tons of data entry. In reality, the first two are nice but not essential. The second two are essential in that I would either need to replicate the functionality or change the way the users are interacting with that particular data. I am looking for help in replicating these in a WPF environment with existing controls(codeplex etc) or in straight XAML. Any code or direction would be greatly appreciated but mostly I am hoping to avoid any commercial 3rd party WPF and would instead like to focus on building them myself(but I need direction) or using Codeplex

    Read the article

  • Parental Controls in Ubuntu - per user

    - by Hamish Downer
    I would like to set up parental controls on Ubuntu for a friend of mine. I want it so that the child user has the controls set, but the parent user is not restricted. To be clear, they are sharing one computer, so a router based solution won't help. And I would like a set of step by step instructions to do this. Just one way of doing it. I'm an experienced Ubuntu user, happy at the command line. I've spent quite some time googling for this along the way. I hope that the GChildCare project will eventually make this easy, but it is not ready yet. In the meantime, the WebContentControl GUI provides a way of managing parental controls, but apply them to every user on the computer (easy WebContentContol install instructions and detailed instructions, discussion and related links on ubuntuforums). The ubuntuforums post has a FAQ that states that user-specific configuration is not possible with WebContentControl, and then provides 3 links he used to help him do it. But they are far from step by step instructions. There is this thread which is notes along the way and linking to this article about squid and dansguardian. And then to these two dansguardian articles which are somewhat in depth ... So does anyone know of an existing guide to how to set up parental controls on ubuntu with some users not affected? If no one has come up with an answer after a little bit, I'll set up a community wiki answer so we can come up with a guide.

    Read the article

  • Retrieving Page Controls Programmatically

    Home » ASP.net » Retrieving Page Controls Programmatically Retrieving Page Controls Programmatically ? There might be situations where you want to retrieve controls that are present in a web page and process them. In that case this article can be very use. Basically a web page is a container for all controls and for retrieving all controls we need to traverse the control tree. So for this this program can be used to disable all form controls at runtime

    Read the article

  • How to build a GridView like DataBound Templated Custom ASP.NET Server Control

    - by Deyan
    I am trying to develop a very simple templated custom server control that resembles GridView. Basically, I want the control to be added in the .aspx page like this: <cc:SimpleGrid ID="SimpleGrid1" runat="server"> <TemplatedColumn>ID: <%# Eval("ID") %></ TemplatedColumn> <TemplatedColumn>Name: <%# Eval("Name") %></ TemplatedColumn> <TemplatedColumn>Age: <%# Eval("Age") %></ TemplatedColumn> </cc:SimpleGrid> and when providing the following datasource: DataTable table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Age", typeof(int)); table.Rows.Add(1, "Bob", 35); table.Rows.Add(2, "Sam", 44); table.Rows.Add(3, "Ann", 26); SimpleGrid1.DataSource = table; SimpleGrid1.DataBind(); the result should be a HTML table like this one. ------------------------------- | ID: 1 | Name: Bob | Age: 35 | ------------------------------- | ID: 2 | Name: Sam | Age: 44 | ------------------------------- | ID: 3 | Name: Ann | Age: 26 | ------------------------------- The main problem is that I cannot define the TemplatedColumn. When I tried to do it like this ... private ITemplate _TemplatedColumn; [PersistenceMode(PersistenceMode.InnerProperty)] [TemplateContainer(typeof(TemplatedColumnItem))] [TemplateInstance(TemplateInstance.Multiple)] public ITemplate TemplatedColumn { get { return _TemplatedColumn; } set { _TemplatedColumn = value; } } .. and subsequently instantiate the template in the CreateChildControls I got the following result which is not what I want: ----------- | Age: 35 | ----------- | Age: 44 | ----------- | Age: 26 | ----------- I know that what I want to achieve is pointless and that I can use DataGrid to achieve it, but I am giving this very simple example because if I know how to do this I would be able to develop the control that I need. Thank you.

    Read the article

  • Iterating through controls on a Windows Form

    - by icemanind
    I seem to have some weird issue going on that I am sure will turn out to be a simple thing. I have a Windows Form and on the form I have 1 panel called MainPanel and inside MainPanel, I got another panel with a button inside and a label that is inside MainPanel, but not in the second panel. 2 controls. What I am trying to do is copy all the controls inside MainPanel over to another panel object. I am using the following C# code to do this: GUIPanel gp = new GUIPanel(); foreach (System.Windows.Forms.Control ctrl in gp.Controls["MainPanel"].Controls) { m_OptionsControl.Controls.Add(ctrl); } When I run this code, it copies over the panel with the button, but not the label. What's even more odd is when I set a breakpoint and run it through the debugger, and I type "?gp.Controls["MainPanel"].Controls.Count" in the immediate window, it returns 2, just like it should. However, when stepping through the code, it only executes the foreach loop once. What am I missing here?

    Read the article

  • How can I loop thru all controls (including ToolStripItems) C#

    - by Murray
    I need to save and restore settings for specific controls on a form. I loop thru all controls and return the one whose name matches the one I want, like so: private static Control GetControlByName(string name, Control.ControlCollection Controls) { Control thisControl = null; foreach (Control c in Controls) { if (c.Name == name) { thisControl = c; break; } if (c.Controls.Count > 0) { thisControl = GetControlByName(name, c.Controls); if (thisControl != null) { break; } } } return thisControl; } From this I can determine the type of control and therefore the property that should be / has been stored. This works well unless the control is one of the ToolStrip family which has been added to a toolstrip. e.g. this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lblUsername, // ToolStripLabel this.toolStripSeparator1, this.cbxCompany}); // ToolStripComboBox In this case I can see the control I'm interested in (cbxCompany) when debugging, but the name property has no value so the code does not match to it. Any suggestions on how I can get to these controls too? Cheers, Murray

    Read the article

  • Controls resize based on screen resolution

    - by user337173
    I have panel control. More controls are in panel.I set the dock property for panel as 'fill' .The panel are resized based on screen resolution. but the controls remains same.The controls in the panel are not resized based on screen solution. i have more labels and panels and text-boxs and button in the same page. How to set the dock property to resize all controls in page based on screen resolution? Thanks for any help

    Read the article

  • Is QtQuick.Controls available on Ubuntu 13.10

    - by javascript is future
    I was looking to do UI development in QML, and I really want it to look native. I found the QtQuick.Controls (http://qt-project.org/doc/qt-5.1/qtquickcontrols/qtquickcontrols-index.html), but when I try make a simple application, it tells me that QtQuick.Controls isn't installed. main.qml: import QtQuick 2.1 import QtQuick.Controls 1.0 Rectangle { height: 200 width: 200 } terminal: $ qmlscene main.qml file:///tmp/main.qml:2 module "QtQuick.Controls" is not installed Also, I downloaded the source from https://qt.gitorious.org/qt/qtquickcontrols/source/stable, ran qmake && make, but this returned the following output: cd src/ && ( test -e Makefile || /usr/lib/i386-linux-gnu/qt5/bin/qmake /tmp/qtquickcontrols/src/src.pro -o Makefile ) && make -f Makefile make[1]: Går til katalog '/tmp/qtquickcontrols/src' cd controls/ && ( test -e Makefile || /usr/lib/i386-linux-gnu/qt5/bin/qmake /tmp/qtquickcontrols/src/controls/controls.pro -o Makefile ) && make -f Makefile make[2]: Går til katalog '/tmp/qtquickcontrols/src/controls' g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_XKB -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_QUICK_LIB -DQT_QML_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt5/mkspecs/linux-g++ -I. -I/usr/include/qt5 -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtGui/5.1.1 -I/usr/include/qt5/QtGui/5.1.1/QtGui -I/usr/include/qt5/QtCore -I/usr/include/qt5/QtCore/5.1.1 -I/usr/include/qt5/QtCore/5.1.1/QtCore -I.moc/release-shared -o .obj/release-shared/qquickaction.o qquickaction.cpp qquickaction.cpp:49:39: fatal error: private/qguiapplication_p.h: No such file or directory #include <private/qguiapplication_p.h> ^ Is there some PPA I could use, or do I have to wait for Trusty to get out, before I can use native controls from Qt? Regards

    Read the article

  • ASP.NET Validator Controls Slowing Down Page

    - by Calvin Nguyen
    Hi all, I have an UpdatePanel that has user controls dynamically added to it. There can be a few dozen user controls at times. The page / UpdatePanel slows down big time on each postback as more user controls are added. After some digging, I was surprised to find the cause is the various CompareValidator, CustomValidator, RegularExpressionValidator and RequiredFieldValidator controls that exist on each user control. Dose anyone have suggestions? It strikes me as very peculiar that inclusion of these ASP.NET controls could have such a horrible effect on performance. Thanks, Calvin

    Read the article

  • Avoid painting over nested controls

    - by Cobus Kruger
    I am writing a toolbar-style control and use the ThemeServices unit to paint the background required by the toolbar. Like so: ThemeServices.DrawElement(Canvas.Handle, ThemeServices.GetElementDetails(trRebarRoot), ARect); I then drop child controls onto the toolbar and voila - instant toolbar. Except that every now and again I notice that the nested (child) controls don't repaint as well. So my control paints its background and the child controls disappear until you move the mouse over them. Some of the edit controls show their client area (no border) and some of them are just gone altogether. This happens mostly when I place a window from another application over the toolbar and move it away. I keep thinking this has to be very easy to cure, that perhaps I'm somehow preventing the paint message from reaching the child controls, or missing an override but I have been unable to figure it out.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >