Wednesday, August 29, 2012

How to set Default File name in Save Dialogue box in silverlight 4

How to set Default File name in Save Dialogue box in silverlight 4

Hi,

I am using Silverligt 4 application. When I export by default file name should display in the save dialogue box. Please give me a c# code to achieve this in Silverlight 4 application. This is very high priority else give me alternate solution to achive in Silverlight 4 application.

Regards,

Santosh

Answers & Comments...

Answer: 1

That feature was added to the SaveFileDialog control in silverlight 5.  Here is a possible work around for silverlight 4 (I did not test):

http://stackoverflow.com/questions/8316799/silverlight-savefiledialog-set-default-file-name



Answer: 2

http://msdn.microsoft.com/en-us/library/system.windows.controls.savefiledialog%28v=vs.95%29.aspx

http://forums.silverlight.net/t/117702.aspx



Answer: 3

hi santoshhegde

private void nmrButton_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog();
dialog.GetType().GetMethod("set_DefaultFileName").Invoke(dialog, new object[] { "FileName.ext" });
dialog.ShowDialog();
}

Thanks & Regards
Mastan Narravula
Mark as Answer", if it helped you or it might help others too.



Answer: 4

Hi,

This I tried I am getting object refernce not set to an instance of an object error.

Regards,

Santosh





No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog