[CLOSED] Change control's default properties value in whole application

  1. #1

    [CLOSED] Change control's default properties value in whole application

    Hi,
    I need to set

    EnableTextSelection="true"
    in all gridviews inside the application (about 100).
    Is possible to set this behaviour in one single point for the whole application?
    Thank you.
    Last edited by fabricio.murta; Oct 20, 2017 at 5:58 PM. Reason: no feedback from the user in 7+ days
  2. #2
    Hello @xeo4.it!

    I believe there's several ways you can do that. But it depends on how your application is drawn.

    For example, if you use in WebForms a shared viewport (or panel) for all your pages, you can just set:

    <Defaults>
        <ext:Parameter Name="enableTextSelection" Value="true" Mode="Raw" />
    </Defaults>
    But that's going to affect not just views within, but anything that supports this setting.

    In MVC, if you use a shared layout, you could also use a similar approach.

    Another alternative, if using free and arbitrary layouts on your page, would be to pull a custom client-side script to apply the setting to any view on grid panels throughout the page. Would involve getting all the view components after page is loaded.

    As the component instances are independent, you can't really set the gridview's EnableTextSelection="true" from global.asax, for example. Instead, modifying Ext.NET server-side code so that it always imprints this value would be a reliable solution across the program, but would require you to always run a custom-built Ext.NET code.

    In a similar approach, you can extend the Ext.NET component and make it always output EnableTextSelection="true", but this one wouldn't be really helpful as you would probably need to change the component reference (for example, from <ext:View /> to something like <mySpc:View />) and well, if you need to do this then you could just add the setting to everyone.

    Well, and another option would be to edit an Ext.NET override for the view component, setting this as default, always. This will have some complexity for the first time you do and will also require to keep a custom-built Ext.NET version.

    Similar to above, you can just add an override similar to this:

    Ext.define("my_overridden_view_defaults", {
        overrides: 'Ext.view.View',
        enableTextSelection: true
    });
    And have this code injected (the .js file run or attached to the file) to every page you load (by a shared view or master page, maybe).

    Well, so there's a lot of ways to do so, but I can't think on a way, for this kind of default override, setting on global.asax or something like it (app_start, web.config...).

    I hope one of the alternatives above is feasible for you.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello Jimmy!

    It's been a while since we last posted a reply here and still no feedback from you. Do you still need help with this? We may mark this thread as closed if you do not reply in 7+ days -- which won't prevent you from posting here afterwards.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Hello Fabricio,
    thank you!
    In our application at the end, we decided to set EnableTextSelection="true" in a specific subset of GridViews.
  5. #5
    Thanks for the feedback, Jimmy! So I guess we're good here, right?
    Fabrício Murta
    Developer & Support Expert
  6. #6
    Yes Fabricio!
    Thanks.

Similar Threads

  1. [CLOSED] Default theme properties
    By mohan.bizbites in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 16, 2013, 4:23 AM
  2. [CLOSED] Apply default Fields properties in FormPanel
    By Digital.Dynamics in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 05, 2013, 4:03 AM
  3. IDEA: Define default properties to prevent tag soup
    By reverseblade in forum Open Discussions
    Replies: 2
    Last Post: Aug 03, 2010, 7:56 PM
  4. [CLOSED] How evoit applying CSS properties to the whole application?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 17, 2010, 6:28 PM
  5. Replies: 5
    Last Post: Oct 08, 2008, 12:46 PM

Tags for this Thread

Posting Permissions