Devexpress DataLayoutControl - how to add controls - devexpress

Is there any way to add or remove controls to/from a DataLayoutControl in DevExpress without deleting all the existing controls? If so, how? I'm using Visual Studio 2017.

DataLayoutControl manages layout items containing child controls. If you need to create a new item, create a new LayoutControlItem as shown in this class description.
To remove a layout item, use the LayoutControl.Remove method.
The Items help article should be also useful since it illustrates how to operate layout items and controls.

Related

Xamarin Forms - Get custom control runtime (with valueconverter?)

I have a Xamarin forms application. It has a page. That page has a listview. The listviews is bind to a sourcelist. What I want is to decide what custom control to use based on a specific property that each item in the list has. How can I achieve this?
It is also required that the custom control binds to values from the list.
I tried the following:
<ContentView Content="{Binding IsPriority, Converter={StaticResource RoadIndicatorBackgroundValueConverter}}" ControlText="{Binding TowingOrder.Location.RoadIndicator}"></ContentView>
That won't work because I can't bind with the ControlText of the specific custom control.
The image above shows the problem. The A1, A50 and the blue icons are all custom controls, those aren't images. There are some more of these custom controls. I can't just make 10 datatemplates right and copy paste everything? That would be so much duplicate code. Can't I just use a base object in a datatemplate, and bind a property with a converter and use a switch/case to decide which custom control to return?
It is not a good design to binding the content of whole layout in runtime.
From the screen shot , it seems that each cell are similar .So you could create a base Custom Control and define all controls in advance and binding the propertyIsVisible in code behind . Then set its value to control which element should been displayed .
If there are do many dig differences between the cells , use DataTemplateSelector is better .

Is there a way to arrange the columns in the grid when the Sales order list page is loaded?

I'm stuck with an issue in the sales order Grid in Dynamics AX 2012 R2. Somehow after adding new columns to the grid via personalization, the newly added columns always shifts to the left side after closing/opening the sales order list page.
Is there any Grid property that handles the arrangement of the columns?
how can we modify the grid columns?
Thanks!
Well, it sounds like an error, this is not how it works for me.
Consider adding the fields to the SalesTableListPage form. The fields are initially (or after reset of user settings) listed in the order in the form grid.
Might look into the list page interaction classes which is responsible for form behavior instead of the AOT on listpages.
more information on the available methods can be found on msdn
https://msdn.microsoft.com/en-us/library/listpageinteraction.aspx
but it is possible for example that a var/isv customization modifies the form after it is loaded

Programatically expand or collapse Telerik grid with detail view

I am using a Telerik grid with a DetailView.
I have the grid rendering correctly, but I was wondering if there is a way to collapse/expand all rows programatically using Java Script?
It works if I do it manually one by one, but I would like to offer a master expand/collapse button for all rows.
Found a solution here:
http://www.telerik.com/community/forums/aspnet-mvc/grid/expand-collapse-all-detailviews-in-a-grid.aspx

Flex 4: Checkbox in Accordion header

I wanted to know if it is possible to add a checkbox in the accordion control.
The main idea is to have a list of selectable items (like selecting various items for checkout) and each of them should have an option to display additional information (the accordion panel).
So basically, 3 questions:
Can I have a checkbox in the accordion header?
Can I have all the panels closed from the start? So the user chooses which panel to open, and not start with one panel displayed.
Can I have multiple panels opened at the same time?
Some notes:
- I tried a header renderer option, but the checkbox was the same for all accordion headers, so it was useless.
- It would be great to avoid the use of libraries or external controls. I am aware of some of the limitations of Flex controls though.
Thanks for any help or information you can provide ! :)
If you're not dead set on using mx controls, I'd give the 4.6 list/item renderer skinning method a try.
I'd use the sparks list control and create a custom item render that's comprised of checkbox control, several nested group/border-container wrappers depending on your design/creative requirements and whatever as3 logic would be necessary to expand and contract the item renderer keyed off of the checkbox's click event or change events-- that's some of the beauty of skinning item renderers in flex 4, you can encapsulate all that dope-ass logic within renderer itself.
In any case, here's some links you might find helpful:
http://www.adobe.com/devnet/flex/articles/flex4_skinning.html
http://blog.flexexamples.com/2009/06/21/creating-a-custom-halo-accordion-header-skin-in-flex-4/
http://saturnboy.com/2009/09/flex4-component-states-skin-states/
hope this helps!

make a cell as template field in GridView

I have a grid view which is dynamically populated with data. and the no.of columns may be changed each time according to the query.. i want to make the first field to select the row of data(by making it template field). I cannot declare statically the columns as template fields because the column numbers are dynamic.
can any one help how to proceed.
You need to create your own template builder - a class implementing ITemplate interface - use InstantiateIn to build your template by adding needed controls to the given template container. Add TemplateField column to the grid-view and use your class as ItemTemplate.
See this article where this is illustrated: http://www.mindfiresolutions.com/How-to-add-a-TemplateField-to-a-GridView-dynamically-841.php
Further, what you want to achieve might be possible by creating your custom DataControlField - for example, for selection column, I may use a class inherited from CheckBoxField (something like http://www.asp.net/data-access/tutorials/adding-a-gridview-column-of-checkboxes-cs)
It's a bit of work but the following article walks through all of the steps: How to create template columns dynamically in a grid view
There is no easy answer for what you're trying to do but the above link will help you if you are willing to put in the time and effort to get it done.

Resources