Turn off field programmatically in VB.Net - vb.net

I'm creating an addin button in Arcmap via VB.net that when clicked, runs the identify tool. But I want only selected fields to appear in the identify dialog. I thought of hiding the unnecessary fields and then showing them again after the button is used.
Does anyone know how to programmatically turn off/on field?

you have to iterate the fields in layer and then set visible property into false .
see this link in
gis.stackExchange

Related

Radio buttons used in a rad grid in batch edit mode

I am trying to find any information about using a radio button in a rad grid in batch edit mode. I have created a template column, then added the radio button control, but it doesn't work in batch edit mode (nothing saves back to the DB). Is it even possible? I can't find anything on the Telerik site so I am suspecting its not supported. Thanks.
The Radio list is not supported in the batch editing mode. Such integration simply has not been implemented. The closest available option at this time is using a dropdown list: http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx. Generally speaking, the standard way of editing boolean fields is through a checkbox column and not a radio button list - check the Discontinued checkboxes column.
What the grid does is that it loops through the controls with JS code when cells are opened and closed and determines control types and the proper API to use (e.g., $get().control.get_value() for dropdownlists, or $get().value for standard inputs). You can try implementing similar logic in the batch editing events.
You can try to use a RadRadioButtonList with the two items declared in its markup and its client-side API (see the get_selectedIndex() and set_selectedIndex() method: https://docs.telerik.com/devtools/aspnet-ajax/controls/radiobuttonlist/client-side-programming/radiobuttonlist-object) together with the following approach of working with templates: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/working-with-templates.
The idea is to have the radio button list in the edit template of the column and to select the correct item in it according to the newly opened cell value on the client, then fetch the selected item from the button list and put it in the grid data source.
You can find one example that you can try using as base in the following thread: https://www.telerik.com/forums/radiobuttonlist-in-gridtemplatecolumn.
Showing a radio button list in the item template is also something that is not supported, as the editing would basically happen in the "display" mode of the cell, and not in the edit mode of the cell. You could try using the server ItemDataBound event and FindControl() (see here: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-template-column) may let you set initial values based on the data source for the radio button lists without data binding them. Then, perhaps a hidden field or hidden checkbox can be used for the actual data binding (see the template article above). You could also try using the batch editing manager changeCellValue() method on the client-side events of the radio button list, in a fashion similar to this article: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes.
Another approach you can consider is to use the client-side events of the radio button list and immediately upon change to call a service that will update the database. This may simplify the template handling logic (you could do this in a read-only column) but it goes against the purpose of batch editing to invoke one request with a lot of data, and you would also need to secure the service.
Another online resource to check is
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes

How to enable datasheet’s filter triangle button in continuous form

Is it possible to use the built in triangle button to filter records for datasheet form in continuous forms?
If not. Then do you think if it is possible to code such a feature?
Also, is it possible to add a select all button within the datasheet form itself instead of placing it in a form containing the datasheet as a subform?
I’m afraid I have no choice but to use continuous forms because of how limiting datasheet forms are.
No, this is not an available feature. Also, no workarounds are available.
You can add an image with the filter icon and try to determine if the column is filtered, but that's both very difficult and not very useful (since you can't get the dialog to adjust the filter when you click on it).
If you want the filter dialog, however, you can just right click one of the fields to add a filter or adjust an existing filter.

How can a ContextMenuToolStripItem be displayed, without doing it programmatically?

I've taken over a project, which contains some UltraWinGrid controls on some of the forms.
On one of the original forms which has been there since before I took on the project, there is a ContextMenuStrip, which has just one ContextMenuToolstripItem on it, captioned 'Default for Column'.
This ContextMenuStrip is hidden by default, however, when the user right-clicks on the UltraGrid, the ContextMenuStripItem is displayed on the grid (rather than at the top of them form where the ContextMenuStrip is).
I'm trying to replicate this behaviour in a new form that I've added myself, however, after adding the ContextMenuToolstripItem in, I cannot get it to display when right-clicking my grid.
I've put a breakpoint on every subroutine in the in the older forms class, and none of them are triggered when right-clicking it.
Additionally I have also searched the class for DefaultForColumnToolstripMenuItem, and the only place it appears is in the Click event of the ContextMenuToolStripItem itself.
So, how else is it possible to show it when right-clicking the grid? I've copy and pasted the ContextMenuStrip from the old form onto the new form and still nothing occurred.
I'm assuming it's in a property somewhere that I'm missing?
Check for a ContextMenuStrip property on the UltraWinGrid. You can set it in the designer and your context menu will appear on right click without having to deal with the MouseClick handler, checking the mousebutton used, etc.

How to edit Expression Blend selected control part?

I am trying to edit a specific control part within a custom TabItem Template. In this case, it's the TemplateBottomSelected control part.
I'm having an issue where I cannot seem to view or edit any control parts within the template editor except the default TemplateTopSelected. Here's a screenshot of what I'm talking about:
Even though I'm selecting the "TemplateBottomSelected" grid, the only thing I can see is the template for the TemplateTopSelected item.
How the heck do I edit the other control parts within the template using the editor?
Thanks!
that's because these templates are either collapsed or the opacity of them is set to 0. :)
you can use the eye toggle button to only show the one you want to modify at design time, set the visibility to visible, do your changes, and reset it to collapsed.
please let me know if you need more info.

Option Group frame: can I add text boxes that are part of the frame instead of rad button options?

Ok so this maybe a simple/silly question but I don't know so here goes:
In access let's say I want to have a frame control, so I click the option group button and add it to the desgin surface. However, I am not wanting to use this as a option group with radio button selection, instead I would like to add text boxes instead the frame, so that when I reference the frame, it references every control instead of it, hence the text boxes, cbo boxes, etc.....just as it would if they were radio option selections.
So can you do this?
I want whatever controls I add inside the frame to be easily referenced (i.e. make all controls visible just by using frameExample.visible = true) so that I can build my own tab control groupings.....
can this be done?
Thanks!
EDIT:
What I am trying to accomplish is having a form that includes a collection of controls (input controls - cbo boxes, text boxes, etc), that serve as the Main record information. These are saved to a table via an INSERT statement on button_click because this form is unbound.
Next I have 8 categories that are relative per each main record (and data that goes along with it). Each of these categories could have a sub form area and a button click that bring it's relative form into the sub form area. These sub forms would be unbound as well as I would just save data via SQL statement. So i know I could accomplish this by running the insert statement from the parent form, on the main collection control's data that would create the KeyID number, then run a SQL statement that would turn around and load that KeyID number right back onto the page in a hidden text box.
Then when I click one of the sub forms and load its relative collection of controls, I could then save that data along with KeyID for each of these sub-forms/tables.
SO......
I was wondering if instead you could define these controls as a collection so that you could hide and make visible all the ones you need on button clicks and avoid the need for additional forms (subs). I know that if a user enters data into a text box, and then somewhere along the way that box becomes hidden, the data still exists in it and still ends up in the SQL statement....
So I want all these controls to exist on the same form, but I thought what is I could encapsulate them into a frame like an option group, then I could call the frame and all the relative controls would be called up (made visible) as needed.
Sorry for the long explanation but I thought it would help.
I do not think you can do it with an Option Group, but what you are describing is pretty much a subform, yesno?
Some examples of hiding the tab control from an app that went live in March 1998:
Tab driven by transparent command buttons over labels styled to look like colored command buttons:
Same approach, more buttons:
In this case, fake colored command buttons don't drive the tab, but insted show/hide the tab and a subform. In this case, the tab is actually driven by the listbox:
A view of when the tab is hidden and the subform revealed. The listbox drives navigation within the subform, which has a visible tab on it:
So, there's a lot that can be done without showing the tab control.