I'm making a simple file upload application that should only accept Excel files.
I've found out how I need to set the filter on the RadOpenFileDialog and I'm throwing an error (via messagebox) when the extension is wrong when dropping a file on the control.
public RelayCommand FilePathChangedCommand => new RelayCommand((ea) =>
{
if (!string.IsNullOrEmpty(FilePath))
{
var extension = Path.GetExtension(FilePath);
if (!extension.In("xls", "xlsx", "xlsm"))
{
//throw error
}
else
{
//process file
}
}
});
When the extension is wrong, I would also like to clear the value in the RadFilePathPicker. But when I make it empty in the FilePathChanged event, it doesn't do anything.
What would be the correct approach to clear the control in this case?
Codebase available here : https://github.com/CrownParkComputing/MegaDownloaderFinal
so using the FolderDialog example for wpf, The binding for the propertt FolderName does not update after selecting a new folder. The original assignment works fine?
Errors shown :
FolderName property not found on object of type String.
IsSearchActive property not found on object of type OpenFolderDialogViewModel.
ItemTemplate and ItemTemplateSelector are ignored for items already of the ItemsControl's container type RadWatermarkTextBox
Please help with these issues I am stumped.
Hi,
I haven't used .Net in a while, I've lost some basic knowledge.
Can someone show me how to fix this underline error?
I am using vb.net.
Please let me know if you need more details.
Thank you!
I have a FilePathPicker with the FilePath property set to a two-way binding to a view-model property. Whenever (in code-behind) I set the corresponding bound property (and then Raise a PropertyChanged notification for it), the FilePath in the text box does not update, no matter what the UpdateSourceTrigger. I cannot understand why.
I went and wrote a test application and reproduced the same effect. Isn't the FilePath property supposed to work as a two-way binding?
Here is the XAML binding.
<
tk:RadFilePathPicker
FilePath
=
"{Binding ReportHeaderImagePath, Mode=TwoWay}"
IconVisibility
=
"Collapsed"
/>
And here is the bound property in the ViewModel
private
string
_reportHeaderImagePath;
public
string
ReportHeaderImagePath
{
get
=> Settings.ReportHeaderImagePath;
set
{
_reportHeaderImagePath = value;
RaisePropertyChanged(nameof(ReportHeaderImagePath));
}
}
When my code sets this ReportHeaderImagePath property to null or string.Empty, I can see the value being set in the debugger and I can see the PropertyChanged event being raised. But still the editor in the RadFilePathPicker does not change. The previous path stays there. I have to either manually edit it or click the little "X" button inside it.
I have tried setting the Binding's UpdateSourceTrigger value all possible choices Default, LostFocus, PropertyChanged and even Explicit. Nothing works.
What am I missing?
We are using the RadFilePathPicker and we can set the theme of the picker control but how do we set the theme of the resulting dialog when the control is opened? The theme does not seem to carry over.
<telerik:RadFilePathPicker DialogType="SaveFile" FilePath="{Binding SaveLocation, Mode=TwoWay}" Margin="0"
WatermarkContent="No File Selected" VerticalAlignment="Center" Height="30" Grid.Row="4" Grid.Column="1"
telerik:StyleManager.Theme="Office2016Touch"/>
Hi,
I have a FilePathPicker with DialogType="OpenFile". Is there a way to set a default directory so that wen a user wants to pick a file, the FilePathPicker opens the the dialog with the files in this directory ?
Regards,
Hans
Is it possible to set a Filter for the OpenFileFialog, when you browse for a file?
Example *.pdf