.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Make a Silverlight TextBox update its binding on every character

Posted By: Asim Sajjad     Posted Date: September 04, 2011    Points: 2   Category :Silverlight
One of the problem which I have faced during my learning and working in MVVM pattern and one of requirement when you have provided the search box as user type in some character in text box control you want to show results in the data grid control. But in silverlight there is only two option when you bind a property to update the source Default and Explicit. There is no PropertyChanged option which is provided in the WPF.

View Complete Post

More Related Resource Links

binding datetimecontrol,dropdown,textbox inside gridview and update each gridviewrow

i have a web part with datetimecontrol(sharepoint) inside a  gridview. when the page loads this this gridview will be loaded with dtc control and the selecteddate would be one of the columns in the splist.also gridview contaisn dropdowns, textboxes, when an update button cliked inside grid, i need to save the info in the splist.  currently i am not getting the value  bound with dtc control. i am getting blank date inside dtc. though in the  rowdatabound event i amcapturing the values due to some reason i am not able to view the value in the DTCcontrol. can anybody give me help me how to achieve this? any  help links/ sample code.. appreciate the help                         

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

Textbox text populated by Session Variable wont update into SQL with new text


Hi everyone, I have what I think is a weird issue. I send text from one page to another via Session Variable. When page 2 loads, the text box has the session text set, but if the user changes the text and clicks the button, the SQL database is update with the original session text. If I remove the redirect from the page 2 button_Click method, then, the page refreshes with the textbox reverting to the session text and thr SQLDataSource has the session text added to it.

Why would the button click cause the textbox refresh with the text from the pageLoad before updating the data source?


Partial Class _1
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Session("UpdateProd") = "Have some text here to send to a textbox on page 2"
    End Sub
End Class

Partial Class _2
    Inherits System.Web.UI.Page


Changing a textbox's readonly property right before update on a gridview


I have a gridview with a date field. I don't want the user to be able to type in their own date and mess up the format so I made the property readonly. That date is then set by a point and click interface. This is all working fine but when the user clicks update this field doesn't update because it's readonly. If i turn readonly off it works so is there a way to turn off the readonly property right before submit?

i want to set textbox(txtTitle) and button by clicking linkbutton but due to update panel it is not

Here this is my html code.....i want to set txtTitle and btnAdd by the GridView1's value....i tried Trigger.but unable to get desired output..can anyone draw me out of this problem??======================================================================================<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">    </cc1:ToolkitScriptManager>    <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"         Width="500px">               <cc1:TabPanel runat="server" HeaderText="Add Category" ID="TabPanel1">            <HeaderTemplate>Add Category            </HeaderTemplate>        <ContentTemplate>                <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>        <asp:Panel ID="Panel2" runat="server" Width="485px"    GroupingText=&q

TextBox shows binding source text when window load, so why not with the ComboBox?

How can I get a ComboBox to show the binding source value when my window opens?  I have been searching all day for a solution to this, but cannot find anything.  So I have created a sample project to demonstrate my problem.  Below is a Vehicle class, very simple, two members Category and Make.  Category is an enumeration, Make is a string. namespace ComboExample { public class Vehicle { // Constants and enumerations public enum eCategory { Road, Air, Sea } // Attributes public eCategory Category { get; set; } public String Make { get; set; } // Construction public Vehicle(eCategory Category, String strMake) { this.Category = Category; this.Make = strMake; } } } Here is the C# for the MainWindow.  A new Vehicle object is created as a member.  In the constructor I set a data-provider in the XAML to this Vehicle object.  There is a button event for showing the values of the controls and objects so I can check the binding. namespace ComboExample { // Interaction logic for MainWindow.xaml public partial class MainWindow : Window { // Attributes Vehicle m_Car = new Vehicle(Vehicle.eCategory.Road, "BMW"); // Construction public MainWindow() { InitializeComponent(); // link data-p

Javascript to update value in Textbox

Hi I have a javascript file, which creates a calendar picker. This file is used through out the application and is a piece of code that I have to use because my .Net application is part of another application which uses this piece of JavaScript code.Anyhow, with the calendar picker I can save the date into a textbox, but the problem that I have is the format. Unfortunately, I cannot change the calendar picker code because this will affect other parts of the application. Therefore, what I am looking to do is to reformat the date on the textbox control. This I can do but only when I use the javascript event onfocus.Now, my question is this, is there away in javascript or with jquery that when a value enters into a textbox that this value is then reformatted to the format I want without postback or clicking on the textbox?Thanks

Auto Binding Constraint doesn't update the UI

I needed a way to auto bind an activities inArgument to its parent activities delegateInArguments (property defined in an activity action). Picture dropping a WriteLine activity into an foreach<string> and having the foreach's argument automatically placed into the in argument of the writelines text property - binding it as it is dropped. I have created the constraint, and it works, including changing the binding to the parent or setting the property back to null if not in a parent.  My problem is that the UI doesn't reflect this.  It actually looks like it is doing nothing - I only know it works because it comes back correctly after a save and load of the workflow pattern. I'm guessing that I somehow need to refresh the model item? How do I refresh the model item from within a constraint? If it helps I have included the code for my constraint below, but note that my need is not as simple as the above example, so this does a couple of other things that don't make sense to this question. static Constraint CheckParent() { DelegateInArgument<GetTaskPermissionsActivity> element = new DelegateInArgument<GetTaskPermissionsActivity>(); DelegateInArgument<ValidationContext> context = new DelegateInArgument<ValidationContext>(); Variable<bool> result = new Variable<bool>(); Variable<

silverlight + WCF Service + Dynamic proxy(custom binding) + basic authentication on iis

hi all, I am having an issue with how to get windows identity in silverlight project. Below is my scenario: the silverlight application need to get data from server via WCF service, i used the way that built dynamic proxy at runtime and aslo used custombinding in this case. Now my application need to deploy on iis and chosen "basic authentication" as a authentication mode. Thus i have chosen authentication mode in WCF was " <security authenticationMode="UserNameOverTransport">". At the client side where kind of project is silverlight that i need have to dynamic proxy with custombinding. My question is: In basic authentication how can i get windows identity to set to chanelfactory.Credentials: _channelFactory = new ChannelFactory<TWebService>(this._binding, new EndpointAddress(_endpointAddress));            _channelFactory.Credentials.UserName = new UserNamePasswordClientCredential();            _channelFactory.Credentials.UserName.UserName = "username";            _channelFactory.Credentials.UserName.Password = "password"; actually, i do not want to use Windows a

How to make the textbox to highlight in C#

Hello All, I have to highlight the textbox when the user enters the Add button. The textbox is in nextpage In the next page which should be highlighted. I tried textbox1.Focus(). It will only highlight the textbox, but to enter the text in it, user should click the mouse on it. I also tried System.Windows.Input.Keyboard.Focus(textbox1); can you please help me to figure out the exact method. Thx, Shilpa

Binding to a textbox

Hi all,   I'm trying to bind to a textbox in the codebehind but can't figure out how to do it. What I'm trying to do is to add fields to a DetailsView control in the codebehind. The following code works perfectly on the aspx page but I can't work out how to do the same in the codebehind....  <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="ID" DataSourceID="ODS_GridView" DefaultMode="Insert"> <Fields> <asp:TemplateField HeaderText="First Name" SortExpression="First_Name"> <InsertItemTemplate> <asp:TextBox ID="InsertFirstName" runat="server" Text='<%# Bind("First_Name") %>'></asp:TextBox> </InsertItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Last Name" SortExpression="Last_Name"> <InsertItemTemplate> <asp:TextBox ID="InsertLastName" runat="server" Text='<%# Bind("Last_Name") %>'></asp:TextBox> </InsertItemTemplate> </asp:TemplateField> <asp:CommandField ShowInsertButton="True&quo

Binding list to form not working with '&' character in list field data

Hi, I have a SharePoint list with a field called Title. I have a form based on this list with the field bound to the form as a label (for workflow to access). Here is the code for the form field. <asp:Label runat="server" id="ff2{$Pos}" text="{@Title}" __designer:bind="{ddwrt:DataBind('u',concat('ff2',$Pos),'Text','','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}" /> I have a workflow that runs through a form action button which take ff2 (title) and  does other stuff. The problem I have is with records where the value of 'title' contains the '&' character (example ab&cd). Blank is pulled in by the workflow when I get the value of ff2. I am guessing it has to do with the data binding and/or escape (special) characters coming through but I don't know how to fix it. Any help will be greatly appreciated

character limit in textbox in range validation

Hey,I am inserting some text in texbox and there is range validation set as minimum as 10 and maximun as 100. But when i run the program, though i insert the text atleast or more than 10 characters, it is showing the error message of this range validation. So I am confused how to set range so that user has to input atleast 10 character minimum ?

Binding SharePoint Multiline textbox to a infopath repeating table Listbox

Hi, I have a InfoPath form  with repeating table control which gets the data from a sharepoint list. I'm trying to bind a multiline textbox to a listbox and intend to get the line by line data entered in the multiline textbox in sharepoint to show as same line by line in the form's listbox. or is there any other way of getting this done.  Thanks.

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object m


How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object model ??

This is my code :

ClientContext clientContext = ClientContext.Current;
                Web oWebsite = clientContext.Web;
                ListCollection collList = oWebsite.Lists;
                ListItem oListItem;

                List oList = clientContext.Web.Lists.GetByTitle("Employees");

                oListItem = oList.AddItem(new ListItemCreationInformation());
                oListItem["Title"] = "My new item";

oListItem["Geography"] = "Kroea";//This is MetaData Field



the oListItem["Geography"] = "Kroea" must be formatted like oListItem["Geography"] = "2;#Kroea",that code will be worked.

The "2

Make the AutoCompleteExtender more like the Netflix search textbox


I am using the autocompleteextender control in a project I am working on for a client, but I would like to be able to match words in the middle of the data I am searching. Controls such as the search textbox on sites like Netflix do this. For example, if I go to Netflix and search for 'wolfman' I get results like:

The Wolfman

The Real Wolfman

House of the Wolfman

With the extender I would only get results beginning with 'wolfman'. If my stored procedure in my webservice is written to do search the text as I want, nothing shows in the extender (I'm guessing because so many top results don't begin with the entered text). Is there a way to get the autocompleteextender to behave more like this?


autocomplete combobox/textbox binding to dataset


Hi All.

I found sample http://www.codeproject.com/KB/WPF/WPFAutoCompleteTextbox.aspxAutoComplete ComboBox where data is hardcoded in the code. I would like to use AutoComplete ComboBox binded to dataset. I don't have a problem binding data to ComboBox but I have problem if need that combobox autocomplete and filtered listbox. That is bit of code which I found

  Public Sub New()

    textBox1.AddItem(New AutoCompleteEntry("Toyota Camry", "Toyota Camry", "camry", "car", "sedan"))
    textBox1.AddItem(New AutoCompleteEntry("Toyota Corolla", "Toyota Corolla", 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend