|
I usually store uploads in a database. Any reason you can't do that?
|
|
|
|
|
And yet it is not the recommended storage method.
The DB is rapidly looking like the best option for this. Mind you it means I have yo reload hundreds of documents/images
Do you store the data in a separate table with a FK to the data eg Document table has the synopsis and details and store the actual file in Upload. If I want a list of documents I don't get all the file data in the List<> or just limit the select to exclude the binary data field.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I just store it in the same table and my SELECT statements are tailored to select only the columns they need. In these applications, the data is usually lazy loaded or loaded on demand (and then discarded) so as to avoid taking up too much memory. Just need to make sure your database is capable of storing large amounts of data (e.g., I'm pretty sure Microsoft imposed some artificial limit -- say, 10GB -- on the express edition of SQL Server).
|
|
|
|
|
Projected size of database with documents and images is about 500mb so DB limits should not be relevant. Paying DASP for DB storage may be!
Which uploader did you base yours on, I stumbled across Sasha's yesterday and left in despair, I need a very light weight and simle one.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mine was actually in an XBAP (WPF) with the proper security permissions to access the local file system. I assume you are working with Silverlight, in which case I can't offer any suggestions, other than what my google-fu produced.
|
|
|
|
|
Can't you write/buy some folder synching software that runs as a service that watches one or more folders and automatically copies new files to another specified folder?
We use SureSync at work, but I've started my own project to do pretty much the same thing.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I think it will be easier to either restructure the web site or store the uploads in the database. As this is a small non commercial app over which I have complete control I don't want to get into any elaborate structures.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
More of a broad question than a specific code question:
What is a good approach to record / (datagrid)row level validation vs. field validation. I have implemented the IDataErrorInfo interface into my model, but that seems really geared towards field level validation, which is great aside from when the user doesn't interact with the specific field.
I have a datagrid that contains a property address, which is broken up into parts. Some of the fields are required, some are not. The fields that are not required might or might not require a certain format if they do have value. I implemented all of this in my model using all the IDataError info interface.
What would be ideal is preventing the user from leaving the row in the datagrid without resolving errors.
Thoughts / Directions?
Cheers, --EA
|
|
|
|
|
if I have XAML:
<Button Width=75 />
by default, it comes out to 21px high. This is fine on Aero, but everything other scheme has a default button height of 23px. Is there a generic way to do this? Surely littering my code with:
if (Aero)
button.Height = 21;
can't be the solution?
|
|
|
|
|
You can apply a global style for buttons that sets the height.
|
|
|
|
|
Is IStyleDispenser's extension GetStylesWithTargetType still a part of System.Windows.Controls.DataVisualization? I'm getting a missing reference or assembly error when I try to use it. Has it been renamed or dropped in favor of another method? Thank you in advance.
|
|
|
|
|
I checked msdn and apparently it's not a part of the Datavisualization toolkit, any longer. Does anybody know of an alternative method? There doesn't seem to be much documentation on the method, itself.
|
|
|
|
|
Hi,
I need to display a listView inside a Treelistview.
I need to Develop a Treelistview wherein each row will have its own sublist which is another listview displayed below the row.There will be an show/hide button in the first column in the main row which will control the show/hide property of the sublist.
I tried Creating a datatemplate for the listviewitemtemplate and tried controlling the showhide in the datatemplate trigger but didnt fully get idea on how can be done.
Can u please let me know some approach to achive this.If possible one sample on how it can be done.
My list view will look like below:
Column 1 || Column2 || Column3 || Column 4|| Column5
Row1
Column 1 || Column2 || Column3 || Column 4
Row1
Row2
Row3
Row2
Column 1 || Column2 || Column3 || Column 4
Row1
Row2
Row3
Can u pls Let me know on how to achieve this view.
Thanks
Krishnan
|
|
|
|
|
Use a hierarcial data template
Everything makes sense in someone's mind
|
|
|
|
|
Xaml:
<sdk:datagridtextcolumn foreground="{Binding Path=Age, Converter={StaticResource ContactListViewModel}, ConverterParameter=GetAgeColor}"
="" binding="{Binding Path=Age}" canuserreorder="True" canuserresize="True" canusersort="True" width="Auto" header="Age">
Converter (in ViewModel):
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
switch(parameter.ToString())
{
case "GetAgeColor":
//Some code
return new SolidColorBrush(Colors.Red);
}
return value;
}
=============
Here Age is type double, I have converter to return different colors of Brushes based age. I'm getting the following error during the loading of the view in InitializeComponent(); Please help, what I'm doing wrong?
{System.ArgumentException: Object of type 'System.Windows.Data.Binding' cannot be converted to type 'System.Windows.Media.Brush'.
at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at MS.Internal.XamlMemberInfo.SetValue(Object target, Object value)
at MS.Internal.XamlManagedRuntimeRPInvokes.SetValue(XamlTypeToken inType, XamlQualifiedObject& inObj, XamlPropertyToken inProperty, XamlQualifiedObject& inValue)}
|
|
|
|
|
When you return a color using a converter, you need to set it to the BackGround or the Foreground, not the Binding.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Sorry I didn't paste the code completely. Please heck this
<sdk:datagridtextcolumn <b=""><foreground="{binding path="Age," converter="{StaticResource" contactlistviewmodel},="" converterparameter="GetAgeColor}"" <="" b="">
Binding="{Binding Path=Age}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Age"/>
|
|
|
|
|
Oops! it again got truncated because I posted in HTML format. Here is right xmal.<sdk:DataGridTextColumn Foreground="{Binding Path=Age, Converter={StaticResource ContactListViewModel}, ConverterParameter=GetAgeColor}" Binding="{Binding Path=Age}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Age"/>
|
|
|
|
|
You are binding your foreground and your main value to Age.
ananddayalan wrote: Binding="{Binding Path=Age}"
ananddayalan wrote: Foreground="{Binding Path=Age, Converter={StaticResource ContactListViewModel}, ConverterParameter=GetAgeColor}"
Age is a media color which you cannot bind a value to.
That must be the issue.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
I came to know DataGridTextColum.Foregorund is not a dependency property. Refer here for more details -> http://forums.silverlight.net/forums/p/207738/488966.aspx#488966
Thanks a lot. I achieved same by using data template.
<sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Height}" Foreground="{Binding Path=Height, Converter={StaticResource ContactListViewModel}, ConverterParameter=GetHeightColor}"></TextBlock> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate>
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Height}" Foreground="{Binding Path=Height, Converter={StaticResource ContactListViewModel}, ConverterParameter=GetHeightColor}"></TextBlock>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
You'd probably find it simpler to create a distinct class for your converter, import the namespace and declare a static resource - your binding expression then simply becomes:
Foreground="{Binding Path=Age, Converter={StaticResource AgeToBrushConverter}}"
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Is it possible to create a Windows Explorer like application in Silverlight?
I want my application to show the drive information, files & folders inside the drive.
Is it possible? If so, how? Please share me some good links. Thanks in advance.
|
|
|
|
|
MichaelGaudioso wrote: Is it possible to create a Windows Explorer like application in Silverlight?
Yes, it is possible. But it needs to be a Silverlight OOB Application.
MichaelGaudioso wrote: I want my application to show the drive information, files & folders inside the drive.
Is it possible?
Again yes, it is possible. I already have an article on the same.
Read it @ CodeProject: File Explorer using Silverlight 4 COM Interoperability[^]
|
|
|
|
|
|
Yes but only in Silverlight 3 and above.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|