Solved

SaveFileDialog (Silverlight 4) - Filter

Posted on 2011-03-15
4
975 Views
Last Modified: 2013-11-12
I´m using filter in SaveFileDialog, but it not appear when I show the dialog box.
What is wrong?

Thanks.



  private void btnDownload_Click(object sender, System.Windows.RoutedEventArgs e)

        {
            SaveFileDialog saveDialog = new SaveFileDialog();
            saveDialog = new SaveFileDialog();

            saveDialog.DefaultExt = ".txt";
            saveDialog.Filter = "Text Files|*.txt|Log Files|*.log|All Files|*.*";
            saveDialog.FilterIndex = 2;  


            if (saveDialog.ShowDialog() == true)
            {
                System.IO.Stream fileStream = saveDialog.OpenFile();
                System.IO.StreamWriter sw = new System.IO.StreamWriter(fileStream);
                sw.Write(Retorno);
                sw.Flush();
                sw.Close();
            }
        }
Image1.jpg
0
Comment
Question by:Plexo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
lenordiste earned 250 total points
ID: 35142768
your code looks fine. I tested it and it does show all 3 filter types. Can you try running your code on another PC and see if the problem still occurs?
0
 
LVL 3

Assisted Solution

by:politex
politex earned 250 total points
ID: 35146755
it's works, you are sure what filter's string at page exact as in your code, possible anything symbol was eaten by parser?
0
 

Author Comment

by:Plexo
ID: 35169057
The problem was in my computer.
Thanks for the help.

In Time..

Is there the possibility of a default file name in Dialog box too?
0
 
LVL 3

Expert Comment

by:politex
ID: 35171441
I think this is denied, because insecure.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question