Where to set EnableRowsCache for Dev Express MVC GridView - devexpress-mvc

I've been following instructions to enable caching in Dev Express gridview for .Net MVC, but I can't seem to find the property EnableRowsCache. Looking at my references, we are using v13.1. If I search my object browser in Visual Studio, I do see the property on ASPxGridView.
My code looks like this:
var gridComboBox = Html.DevExpress().GridView(
settings =>
{
settings.SettingsText.Title = "Account Info";
settings.Name = "gvCustomerAccounts";
settings.EnableRowsCache = true; //Doesn't compile, also flagged by Resharper
Was this property introduced on a later version, or is it not suitable for this gridview, or am I using it wrong?

As per Dev Express support, this property was added in version v2013 vol 2, after my edition.

Related

Debuging es6 Proxy as property -> Internal error: illegal access

If I, in node.js 6.6, write (resp. have transpiled from TypeScript) a class like that:
class Table {
constructor(args) {
this._rows = new Proxy({ test: 42 }, {});
}
}
And instantiate it like this:
var table = new Table();
When I debug in Visual Studio Code 1.2.1 when I want to watch the var table I always have
Internal error: illegal access
written there, meaning I can not watch table or any of its properties.
The same thing works perfectly fine in Chrome.
So, why is that and what can I do about it?
Thanks!
For those coming here first. It is indeed a bug this happens however Microsoft traced it to depreciated v8 debug code inside node.js itself. The workaround is to use "type": "node2" in your launch configuration file. This tells vscode to use the new debug protocol. Node 7+ is also recommended. Support for both is considered experimental as of vscode 1.10 and should used only if needed.
As of vscode 1.10 the "node2" code is being merged with "node". "type":"node2" is depreciated in favor of the "protocol" attribute. If set to "auto" the protocol will be switched automatically based on runtime determination. Setting to attribute to "inspector" simulates the effects of "node2" forcing the new debug protocol to be used. The default setting is equivalent to using "type":"node" in vscode 1.8.x, 1.9.x.

a weird field appear in android studio

i have a pojo class
run this code
Field[] fields = clazz.getDeclaredFields();
i got a field under Android Studio IDE :
its type is interface com.android.tools.fd.runtime.IncrementalChange
its name is $change
My Android Studio version is 2.0 Preview 4
the pojo class which i definded by myself didn't have $change field
when i run the code in eclipse, it works normal.
where did the field come from?
how can i avoid this field , is there some setting in Android Studio ?
Instead of turning off instant run we can resolve this issue by utilising synthetic modifier check. 'com.android.tools.fd.runtime.IncrementalChange' is synthetic so we can check whether the field is synthetic using isSynthetc method.
Field[] fields = objClass.getFields();
for (Field field : fields) {
String name = field.getName();
Object value;
if(field.isSynthetic()){
continue;
}
//add your code here
}
Most likely this field is added in order to support the Instant Run feature added in Android Studio 2.0, and will not appear if you turn off Instant Run.
I think diordna answer is best link。install run is Android Studio new function,I won't close it。
I use JsonTool link in my sdk library ,when I run my app with androidStudio2.2 JsonTooll.objectToJson() give me a bad json String ,I add code
if (name.contains("this$") || field.isSynthetic()) continue;
solve it

Visual Studio Addin not showing

I've created very simple Visual Studio Add-in, ala this article by JP Booodhoo.
http://codebetter.com/jpboodhoo/2007/09/04/macro-to-aid-bdd-test-naming-style/
The addin works in debug, so if I F5 in the add in solution, and open a solution then the addin shows in the tools. However, it doesn't show when not debugging. i.e. after I've deployed the addin, closed and re-opened my solution.
Am I missing something?
In terms of deployment, I followed the deployment steps in this article and deployed it to C:\Users[your user name]\Documents\Visual Studio 2012\Addins
Alternative to macros in Visual Studio 2012
public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
{
handled = false;
if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
{
if(commandName == "KinghamExtensions.Connect.KinghamExtensions")
{
var selection = (TextSelection)(_applicationObject.ActiveDocument.Selection);
selection.SelectLine();
if (selection.Text == "") return;
var prefix = "public void ";
var index = selection.Text.IndexOf(prefix);
prefix = selection.Text.Substring(0, index) + prefix;
var description = selection.Text.Replace(prefix, String.Empty);
selection.Text = prefix + description.Replace(" ", "_").Replace("'", "_");
selection.LineDown();
selection.EndOfLine();
handled = true;
}
}
}
As I say, the code works when running the addin from vs in debug, but doesn't show in the tools menu.
Also, it doesn't show up in the keyboard options like the Git Extensions addin does meaning I can't assign a key binding.
Any thoughts?
It is hard to answer by the information you given, but at first you should check the followings:
Your AddIn should appear in the Tools>Add-in Managger...
If you set the first check box before it, than it should be loaded.
If it isn't and you get an error message, click to no, else the Studio will rename the deployed .AddIn file.
You should check if your release assembly is at the place referenced by the Assembly element like this: <Assembly>C:\Users[your user name]\Documents\Visual Studio 2012\Projects\MyAddin1\MyAddin1\bin\MyAddin1.dll</Assembly>
in the .AddIn file deployed by Visual Studio to the AddIn folder you mentioned in your question.
If it is, and the error pesrists, you should add some log to your Add-In (a Windows MessageBox will do)
and place it to the OnConnection method. The error can appear either OnConnection throws an Exception while the IDE trying to load it, or the FullClassName element in the AddIn file refers to an other name than your Connection class has.
If you get no errors and your OnConnection runs properly, then it could be an exception thrown while your code is adding your command, - if you do the same way as it is in a generated Add-In template in a try/catch block- and you need to resolve it.

Using standard Visual Studio windows programmatically

I'm trying to programmatically call standart "Create Work Item" window in Visual Studio 2012. I was trying to make it by using GUID of command, but it doesn't work.
DTE dte = Package.GetGlobalService(typeof(DTE)) as DTE;
dte.Commands.Raise("{4BCF92C9-7FEA-4913-AF26-F93582BA9C7A}", 196608, null, null);
I was trying to find something in Microsoft.TeamFoundation.WorkItemTracking.Client, but it's not giving me the right result.
If you have a Team Foundation Server setup, which it looks like you do, then you can probably achieve this by working through the tfs web portal. For me the "Create Work Item" is found under:
http://myserver:8080/tfs/<Collection>/<Project>/_workItems
I resolve my problem.
To programmatically call standart "Create Work Item" window in Visual Studio 2012, use DocumentService interface.
In my case it's look like this:
using Microsoft.TeamFoundation.WorkItemTracking.Client;
using Microsoft.TeamFoundation.WorkItemTracking;
using Microsoft.VisualStudio.TeamFoundation;
using Microsoft.VisualStudio.TeamFoundation.WorkItemTracking;
...
private DTE dte;
private EnvDTE80.DTE2 dte2;
...
dte = Package.GetGlobalService(typeof(DTE)) as DTE;
dte2 = (EnvDTE80.DTE2)dte;
DocumentService documentService = dte2.DTE.GetObject("Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.DocumentService")
as DocumentService;
WorkItem workItem = new WorkItem(workItemType); // Use type what you need
object a = new object();
IWorkItemDocument widoc = docService.CreateWorkItem(workItem, a);
docService.ShowWorkItem(widoc);

Setting Caliburn IWindowmanager's Owner Property to Excel with handle HWND

I have an Excel Vsto addin application in which I host WPF application build using Calibrun Micro Autofac.I have a dialog popping up the excel and I want that Pop up window's Owner to be set to this excel window.Only way I see doing this is using WindowInteropHelper Class which needs Window instance.
And I am using settings like this :
dynamic settings = new ExpandoObject();
And I show window like this :
windowManager.ShowDialog(viewModel, settings: settings);
So What should I do to set the settings.Owner Property to this excel window(Whose Handle is known) so that the Pop up window is always on top of excel window??
It looks like you are hosting a WPF application (add-in) inside Excel which is an Office application and Caliburn.Micro has a constructor in BootstrapperBase class exactly for this situation, it looks like this: BootstrapperBase(useApplication = true), so you should derive your bootstrapper from BootstrapperBase and pass in false to the base constructor. something like this:
class MyBootstrapper : BootstrapperBase {
MyBootstrapper()
: base(false)
{
}
}
Then Caliburn.Micro will set the owner property correctly for you, you don't have to worry about it. Now if you knew about this but it didn't work for then comment on this and i will give you a solution specific to your situation.
Edit: To set the owner of the created window we need to set the Owner property (which is of type Window) but the problem is that you are working with a native win32 window so you only have a handle and WPF windows don't accepts handles as Owners, and the second problem is that we don't have a reference to the created window so we can wrap it inside a WindowInteropHelper, in order to solve this i suggest the following:
Add information to the created window so we can identify it later, we can do it like this:
var settings = new ExpandoObject();
settings.Tag = "THE_ONE"
windowManager.ShowDialog(viewModel, settings: settings);
After doing so we need to get a reference to that window, so we can
do something like this: var ourWindow = Application.Current.Windows.FirstOrDefault(w => w.Tag == "THE_ONE");
Now we wrap that with a WindowInteropHelper like this: var
interopHelper = new WindowInteropHelper(ourWindow);
Now we can set owner to the native window handle like this:
interopHelper.Owner = (IntPtr) //
PUT_YOUR_NATIVE_WINDOW_HANDLE_HERE;
That's all i can help you with, i hope it works.

Resources