what SelectEntitySettings.GridConfig change to in Vault 2016

what SelectEntitySettings.GridConfig change to in Vault 2016

wesbird
Collaborator Collaborator
672 Views
3 Replies
Message 1 of 4

what SelectEntitySettings.GridConfig change to in Vault 2016

wesbird
Collaborator
Collaborator

Hi, 

I'm working on migration my AddIn from 2014 to 2016. here is one item I have difficult:
SelectEntitySettings.GridConfig

I search in google, autodesk forums, blogs but found nothing.
I tried
settings.OptionsExtensibility.GetGridConfiguration = config;
it does not works.

What should I change my code?


Thanks
Wes

Windows 10 64 bit, AutoCAD (ACA, Map) 2023
0 Likes
Accepted solutions (1)
673 Views
3 Replies
Replies (3)
Message 2 of 4

wayne.brill
Collaborator
Collaborator

Hi Wes,

 

Maybe you could use the approach in the Vault Browser SDK sample:

C:\Program Files (x86)\Autodesk\Autodesk Vault 2016 SDK\vs12\CSharp\VaultBrowserSample

 

It uses Vault.Forms.Controls.VaultBrowserControl.Configuration and then calls the SetDataSource() of the VaultBrowserControl passing in that configuration.

 

If this does not help attach a small project I can use to research the problem. (let me know if you want to keep it confidential)

 

Thanks,

Wayne

 

 

 



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

wesbird
Collaborator
Collaborator

Thank you, Wayne. 

 

I check the code in C:\Program Files (x86)\Autodesk\Autodesk Vault 2016 SDK\vs12\CSharp\VaultBrowserSample. 

In my case I use:

var results = VDF.Vault.Forms.Library.SelectEntity(conn, settings);

I cannot find place to set configuration. Any idea?

 

 

 

Thanks

Wes

Windows 10 64 bit, AutoCAD (ACA, Map) 2023
0 Likes
Message 4 of 4

wayne.brill
Collaborator
Collaborator
Accepted solution

Hi Wes,

 

Here is a reply I found with a suggestion to try:

>> >>

Fill in the SelectEntitySettings.OptionsExtensibility.GetGridConfiguration.

 
• Below I’ve code similar to the default that happens if you don’t fill this in, but I’ve modified it to remove the “Author” property and the “Approved by” property.  If you have a particular property you want to remove, then debug the below code and look at the propDefs variable to figure out the key name of the property you want to remove.


• I’ve also modified it to get properties which are only active (I think this is what you want).  See the last parameter of the call to GetPropertyDefinitions below:

 

            Vault.Currency.Properties.PropertyDefinitionDictionary propDefs = connection.PropertyManager.GetPropertyDefinitions(null, null, Vault.Currency.Properties.PropertyDefinitionFilter.OnlyActive);

            // Remove "Approved By" and "Author"
            propDefs.Remove("1301cf04-4252-4d4a-8982-12e082d54211");     
            propDefs.Remove(Vault.Currency.Properties.PropertyDefinitionIds.Server.Author);

 

            Vault.Forms.Controls.VaultBrowserControl.Configuration initialConfig = new Vault.Forms.Controls.VaultBrowserControl.Configuration(connection, "SelectEntityDlg." + settings.PersistenceKey, propDefs);
            initialConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Client.EntityIcon);
            initialConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Client.VaultStatus);
            initialConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName);
            initialConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Client.VaultStatusModifier);
            initialConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.CheckInDate);
            initialConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.Comment);
            initialConfig.AddInitialColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.ThumbnailSystem);
            initialConfig.AddInitialSortCriteria(Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName, true);
            initialConfig.AddInitialQuickListColumn(Vault.Currency.Properties.PropertyDefinitionIds.Client.EntityIcon);
            initialConfig.AddInitialQuickListColumn(Vault.Currency.Properties.PropertyDefinitionIds.Client.VaultStatus);
            initialConfig.AddInitialQuickListColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.EntityName);
            initialConfig.AddInitialQuickListColumn(Vault.Currency.Properties.PropertyDefinitionIds.Client.VaultStatusModifier);
            initialConfig.AddInitialQuickListColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.CheckInDate);
            initialConfig.AddInitialQuickListColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.Comment);
            initialConfig.AddInitialQuickListColumn(Vault.Currency.Properties.PropertyDefinitionIds.Server.ThumbnailSystem);

           

            settings.OptionsExtensibility.GetGridConfiguration = e => initialConfig;

<< <<

 

If this does not help please provide a project I can use to research this issue.

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network