.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

Masked Text box editing is difficult

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :WPF
I've implemented Matthew MacDonald's MaskedTextbox control, from his book, "Pro WPF in C# 2008".  It works fine, with one or 2 exceptions.  One of them is that when a user selects all of the contents in the textbox, they're used to hitting the delete key and that clearly everything out, so they can type over it.  For example, I've got a mask of "000000" for one of the boxes.  The users are used to selecting all 6 digits and then hitting the delete key and having that clear it out.  But this doesn't work that way.  Instead what they have to do is go to the end of the 6 digits and then hit the backspace kery 6 times.  That isn't anywhere near convenient as the old MaskTextBox in WinForms.  What can I do to make get this functionality back?Rod

View Complete Post

More Related Resource Links

Toolbox: Powerful Text Editing, Web Testing in .NET, Extended Unit Testing, and More


Powerful Text Editing, Web Testing in .NET, Extended Unit Testing, and More

James Avery

MSDN Magazine February 2008

gridview tablecell text emptystring in RowDataBound event when editing


HI and thanks in advance.  asp.net using vb, using a codebehind page.

I have a relatively simple gridview bound to an product table that displays great.  The problem comes when I choose to edit a row.  When I do so, the gridviews' RowDataBound event fires and the values of the text properties of the tablecells in the row evaluate to "" emptystring. 

I do notice that if I break within the GridView1_RowDataBound event during a refresh of the page, the values are there.  But again, when I hit the "Edit" button in the first column (the CommandField column) .  Text properties of the cells resolve to ""

 Here is the code for the event, followed by the gridview in the form (inside an updatepanel)

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then  ' not a header, footer row.. etc.
            Dim cellProductNumber As TableCell = e.Row.Cells(3) ' ProductNumber column

'>>>>> after clicking "update", even though a value displays in the gridview,
' the cellProductNumber.Te

Rich Text Editing in Firefox


Hey all,

I'm using an InputFormTextBox to ask a user to input text, it only displays bold/italic/fancy options in IE though! I thought this had been approached for Sharepoint 2010, is there a way I can get this rich text control to display in all browsers (firefox/chrome) rather than defaulting back to the HTML view?



Masked text box text alignment


Hi All,


I have an issue which smells like a culture issue, but I can't find any difference in the language/region settings.


I have a windows forms application using masked edit text boxes to display comma separated numbers. The boxes' RightToLeft property is set to 'Yes' and the TextAlign property is set to 'Left'. This is so that the mask is aligned to the right, and when focus moves to that edit box the cursor is at the far right and the number expands to the left as you type.


When I package the app up and deploy it, the mask is still aligned to the right, but the cursor goes to the left-most position, and the number expands to the right as you type.


This looks like an environment problem to me, but I can't see anything in the language and regional settings on my test box that's different from my development machines.


Any ideas?



How to get text from Masked Text Box without the masked format while its empty


Hi there,

   Im using a maskedtextbox with mask value of "000-00-0000" . If I try to get the text value of the maskedtextbox while its empty its returning "   -  -". I would like to get empty string wen no data entered.

Please do the needful ASAP.

Thanks in Advance,

Mark As Answer or Vote As Helpful if My Reply Does.

How to make masked text box for TabletPC?.


hi Juhani,

I have a requirement like to create masked textboxes(Phone number with extension, zip,SSN)..I created them successfully..but if I ran my app on tablet PC and entering data with pen..then the mask and validation not working properly.

For ex: (___) ___-____ for this if I use pen and enter phone number i.e., 7324859000...in the masked textbox it is showing like this...   (7324859000___) ___-____.

Is there any chance to fix this. I am getting headache with this.

Please help me if you can.



editing the text of a textbox inside the data template of an expander header template


hello I have the following expander




<Expander Grid.Row

New paragraph when editing text in gridview


Hi all,

I have a gridview which I use to edit text fields. How is it possible to start a new paragraph when entering text? I'm hoping that this can be done without using markup, as the users are not neccessarily going to be particularly computer literate.

Editing the Data in a GridView

In addition to deleting a GridView's underlying data, another common need is to allow end users to edit the data displayed in a GridView. With ASP.NET 1.x's DataGrid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. With the GridView and ASP.NET 2.0, it is possible to create an editable GridView without writing a single line of code! All of the necessary functionality is encapsulated within the GridView.

The GridView allows editing on a row-by-row basis. An editable GridView contains an additional column with an Edit button in each row. When the end user clicks on an Edit button that row becomes editable, causing the Edit button to change to Update and Cancel buttons and the other columns to become TextBoxes. The end user can then update one or more column values and click Update to save their changes.

How Do I Enable Inline GridView Editing?

Now that you have created a site with Edit and Details views, how do you enable inline editing in a GridView control? This video shows you how, and also touches on routing.

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

AutoCompleteStringCollection for text box in DataGridView 2.0

I have been searching for a way to have autocomplete in a DataGridTextBox
object. There does not appear to be an obvious way to do this like you would
for a TextBox outside of a grid using the AutoCompleteCustomSource. Any
thoughts on how I can add this collection? :)

Built-in Functions - Text and Image Functions in SQL Server

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Built-in Functions - Text and Image Functions

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Conversion of text files from ANSI to UTF-8

reading and writing text files in ANSI format and
writing html-files in Charset ISO-8859-1 (Western Europe).

Text to Voice

Text to Voice and Voice to Text convert

Voice to Text conversion:-

Gridview with a dropdown list for editing


Hello. I am working through Scott Mitchell's ASP.Net in 24 hours book. I am finishing the photo album project.

I have a GridView that retrieves a list of uploaded photo rows for the logged-in user.
The GridView is for editing and deleting rows.

The photo Category field in the Gridview is a dropdown list. The text entry field was deleted after converting this field to a Template.

Like the uploaded photos, these Categories are user-specific. They are created in another web page.

Users also have the option to select "none" for the category when they upload an image.

For the GridView:  The Category ID field's ItemTemplate and EditItemTemplate both have a " - None - " choice added to them.

I am getting this error:

'pictureReadOnlyCategories' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value


Note: The ID for the ItemTemplate for that dropdown list is the ID listed above in the error: "pictureReadOnlyCategories".


Am I missing some step in this process of changing a GridViews text field to a dropdown that can be used for editing? I went through the book's instructions three times.

Here is my code for the dropdown list and a screenshot of the Design

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