venerdì 28 gennaio 2011

Windows 7 non aggiorna i file copiati, nuovi o cancellati

Se anche a voi capita che windows 7 (64bit) non aggiorna in esplora risorse, i file che create o copiate, provate questa soluzione, a me ha funzionato:

Open regedit, and go to:

HKEY_CLASSES_ROOT\CLSID\{BDEADE7F-C265-11D0-BCED-00A0C90AB50F}\Instance\
And change DontRefresh to 0.

Se la chiave di cui sopra non esiste, createla!, trovato su:
http://www.windows7taskforce.com/view/3103

martedì 21 aprile 2009

Attenzione ad installare Infragistics vol 2009.1

Installando la versione 2009 vol.1 dei componenti Infragistics (windows form) si va incontro a un bug abbastanza fatidioso: Non è più possibile usare il controllo UltraDateTime editor pena il sollevamento di una exception, questo è vero per tutte le applicazioni che non siano localizzate in en-US.
Sono stato quindi ovviamente costretto a disinstallare la suddetta versione dei componenti per tornare a quella precedente .... ditemi voi se è possibile che una azienda produttrice di componenti si permetta di lasciare in produzione un bug di questo tipo!

martedì 3 febbraio 2009

Carattere di controllo del Barcode delle raccomandate

Per chi ha la necessità di calcolare/controllare il carattere di controllo (quello dopo il ‘-‘) del barcode delle raccomandate poste italiane ecco il codice C#:


public class BarCode
{
public static string Get25InterlPostali(string valore)
{
StringBuilder tmp = new StringBuilder();
int check;
int totale;

try
{
totale = 0;
if (valore.Length == 11)
{
for (int i = 1; i <= 11; i++)
{
if (i % 2 == 1)
totale += int.Parse(valore.ToCharArray()[i-1].ToString());
else
totale += int.Parse(valore.ToCharArray()[i-1].ToString()) * 11;
}

tmp.Append(totale.ToString());
totale = 0;

for (int i = 0; i < tmp.Length; i++)
totale += int.Parse(tmp.ToString().ToCharArray()[i].ToString());

check = totale % 10;

return check.ToString();
}
else
return null;
}
catch
{
return null;
}
}
}

Trovato su google in delphi e tradotto in c#: Delphi

giovedì 22 gennaio 2009

Setting focus to a Filtering cell in WinGrid - Infragistics Forums


Setting focus to a Filtering cell in WinGrid - Infragistics Forums
: "
D: I need to be able to set the focus to a Filtering cell when the form activates for the first time or programmatically.

For example, I have a list of products and when the user shows the list, the first cell that is activated and focused should be the cell where the user can type a product name and search to filter the list. So the user does not need to move the cursor by the mouse!

R:Here's one way to do it:

bool hasActivated = false;
private void Form1_Activated(object sender, EventArgs e)
{
if (this.hasActivated)
return;

this.hasActivated = true;
this.ultraGrid1.Rows.FilterRow.Cells['String 1'].Activate();
this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
}"

Focus on FilterRow - Infragistics Forums

Focus on FilterRow - Infragistics Forums: "You could do something like this:
this.ultraGrid1.Focus();
this.ultraGrid1.ActiveCell = this.ultraGrid1.Rows.FilterRow.Cells[0];
this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
Note that this will not work if you try to do it in the Forn_Load event of your form, because this event does not allow you to set focus to a control. So if you want your form to come up with the filter cell active initially, I recommend using a BeginInvoke. Like so:

private void Form1_Load(object sender, System.EventArgs e)
{
// Set grid's DataSource

this.BeginInvoke(new MethodInvoker(this.SetFocusToFirstFilterCell));
}

private void SetFocusToFirstFilterCell()
{
this.ultraGrid1.Focus();
this.ultraGrid1.ActiveCell = this.ultraGrid1.Rows.FilterRow.Cells[0];
this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
}"

giovedì 8 gennaio 2009

Come numerare in reporting services le righe di una matrice

Supponendo che il campo di raggruppamento per righe sia "campo1" è sufficiente usare questa espressione: =RunningValue(Fields!campo1.Value,CountDistinct,Nothing)

trovato su: www.sqlreportingservices.net

domenica 4 gennaio 2009

Crash VisualStudio toolbox quando si aggiunge una scheda

Il problema si verifica quando sono installati i power commands
Posto parte del messaggio dal newsgroup di visualstudio, il metodo 1. da me ha funzionato :)


====================================================
After looking around the web, I could not find a perfect solution or workaround for this compatibility issue. I would suggest you to uninstall and wait for the next release of PowerCommands. In the meanwhile, I also found that product team has already known this issue and they are working on a fix on that right now. It is described at
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=365943. I also put those possible solutions or workarounds I found from online community and they are just a reference for you. Although they are not proved to be 100% to solve this problem, you could have a try if you still want to use VS 2008 SP1 and PowerCommands altogether. For you convenience, I put how many efforts you may need so that you can determine if it is worth to have a try.1. (This method is quick to implement, about 5 minutes) Find devenv.exe.config in "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE". Add following XML token to the dependentAssembly list just after office one.
-------------------------------------------------------------
  <dependentAssembly>
                <assemblyIdentity name="office"
publicKeyToken="71e9bce111e9429c" culture="neutral"/>
                <codeBase version="12.0.0.0"
href="PrivateAssemblies\Office12\Office.dll"/>
            </dependentAssembly>
<!-NEW STUFF-->
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.PowerCommands"
publicKeyToken="null" culture="neutral"/>
                <codeBase version="1.1.0.0" href="C:\Program Files
(x86)\PowerCommands\Microsoft.PowerCommands.dll"/>
            </dependentAssembly>

-------------------------------------------------------------
After that please try "Choose Items" again and check if crash happens.2. (This method will take long time because it needs reinstall VS 2008 sp1 and .NET Framework 3.5 SP1, about 30 minutes) Uninstall the Visual Studio 2008 SP1,.NET Framework 3.5 SP1 and PowerCommands. Reinstall Visual Studio 2008 SP1 and .NET Framework 3.5 SP1 first and then install PowerCommands. Please don't use repair, some folders or files will not be updated during repair.