Sejal
Sejal

Reputation: 1

Default file name for SaveFileDialog c#

I have few forms that export the grid data to excel, each time the form exports it calls the SaveFileDialog contol - for which I have a different form that remains the same for all the forms that need the SaveFileDialog, What I need to do is while saving the file, I want to display a default file name but it should be specific to the form not same for all the forms. I want to do that for C# windows application

Upvotes: 0

Views: 2810

Answers (1)

Mohit S
Mohit S

Reputation: 14024

There is property called FileName for SaveFileDialog which can be given for giving a default file name.

SaveFileDialog sfd = new SaveFileDialog();
sfd.FileName = "WhateverNameYouWant" //WithExtension

Upvotes: 3

Related Questions