profile for Cullen Tsering at Stack Overflow, Q&A for professional and enthusiast programmers

Thursday, July 23, 2009

Populating controls in FormView Insert or Empty empty template with default values

FormView doesn't make it easy for a developer when he wants to populate the controls in a empty or insert template with default values.  After doing some search, I found out one way to accomplish this is to override ItemCreated event as follows:

        protected void fvMine_ItemCreated(object sender, EventArgs e)
        {
//if the current mode in insert mode
              if (fvMine.CurrentMode == FormViewMode.Insert)
              {
//get a reference to the control
                            txt = (TextBox) fvMine.Row.FindControl("txtCity");
                            if (txt != null)
                            {
// populate it with a default value
                                txt.Text = "New York";
                            }

Monday, July 20, 2009

Delayed TextBox TextChanged event

I have a textbox that does a search upon TextChanged event firing.  However, I don't want it search for every character the users types unless the user is done with typing.  So I wanted to delay it from firing.  I found a great article here that describes exactly what I wanted.  It uses System.Timers.Timer but I changed it to System.Windows.Forms.Timer.

WCF Send/Receive Progress Update

After searching around the web, I didn't find any satifactory article.  So posted a question on StackOverflow.com.

WCF Message Send/Receive Progress

I've been working a project that involves sending/receiving messages to a server from a desktop application via a WCF webservice.  When transferring a large chunk of message, I'd like to display a progress indicator to the desktop user.  I'm going to do a little bit of research to find such a solution.

About Cullen

My photo
Christian, Father, Software Developer/Architect who enjoys technology and using it to make people's lives easier!

Followers