Solved

SaveFileDialog (Silverlight 4) - Filter

Posted on 2011-03-15
4
974 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

740 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