Problem with Grids

  1. #1

    Problem with Grids

    Hi,

    Im trying to create a grid for my application and its not being possible.

    I Have copied your example about a basic grid and is still not working. Here is what i've tried:

    <%@ Page Language="C#" %>
    
    
    <!DOCTYPE html>
    
     <script runat="server">
        public static List<object> Data = new List<object>
        {
            new
            {
                name = "Lisa",
                email = "lisa@simpsons.com",
                phone = "555-111-1224"
            },
    
            new
            {
                name = "Bart",
                email = "bart@simpsons.com",
                phone = "555-222-1234"
            },
    
            new
            {
                name = "Homer",
                email = "homer@simpsons.com",
                phone = "555-222-1244"
            },
    
            new
            {
                name = "Marge",
                email = "marge@simpsons.com",
                phone = "555-222-1254"
            }
        };
    </script>
    
    <html>
    <head runat="server">
        <title>Ext.NET Mobile Example</title>
       
    </head>
    <body>
        <ext:ResourceManager runat="server" Theme="Triton" />
    
        <ext:Grid runat="server" Title="Simpsons">
            <Store>
                <ext:Store runat="server" DataSource="<%# Data %>" AutoDataBind="true">
                    <Fields>
                        <ext:ModelField Name="name" />
                        <ext:ModelField Name="email" />
                        <ext:ModelField Name="phone" />
                    </Fields>
                </ext:Store>
            </Store>
            <Columns>
                <ext:Column runat="server" Text="Name" DataIndex="name" Width="100" />
                <ext:Column runat="server" Text="Email" DataIndex="email" Width="210" />
                <ext:Column runat="server" Text="Phone" DataIndex="phone" Width="150" />
            </Columns>
        </ext:Grid>
    </body>
    </html>
    This shows the Grid, but it shows it empty, theres no data on it.


    And another question (I dont know if I should open a new thread for it):

    Is it possible to make something like "command column" to select a row like we can do in Ext.Net? I would like to do something like MultiSelectionGrid to select one or various rows, but I would like to select and insert them into a List, not to delete them.
    Last edited by PascuV; Sep 13, 2018 at 8:55 AM.
  2. #2
    Hello? Any help?
  3. #3
    Hello @PascuV! Thank you very much for bumping the thread, and sorry for taking so long to reply. We are going to review your inquiry right away and post you a feedback, just wanted to post this feedback to let you know we are looking at your inquiry now.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Hello again, @PascuV!

    The issue is actually a limitation from Ext.NET Mobile that's easily addressable by setting up a viewport to the page.

    Preferably, you should use a ViewPort block and enclose everything that's on the page within it. Alternatively, say, if you just want to show that grid on the page and set up everything else within the grid (maybe close or back buttons, etc), you can just add the Fullscreen="true" setting to the grid definition.

    Notice the Fullscreen setting is a shorthand for wrapping the viewport around the component, and should only be used in one -- the outermost, if there are more than one -- component of the page.

    Here's how the same code you provided should look like when you wrap a viewport around it:

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title></title>
    
        <script runat="server">
            public static List<object> Data = new List<object>
            {
                new
                {
                    name = "Lisa",
                    email = "lisa@simpsons.com",
                    phone = "555-111-1224"
                },
    
                new
                {
                    name = "Bart",
                    email = "bart@simpsons.com",
                    phone = "555-222-1234"
                },
    
                new
                {
                    name = "Homer",
                    email = "homer@simpsons.com",
                    phone = "555-222-1244"
                },
    
                new
                {
                    name = "Marge",
                    email = "marge@simpsons.com",
                    phone = "555-222-1254"
                }
            };
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager runat="server" />
            <ext:Viewport runat="server">
                <Items>
                    <ext:Grid runat="server" Title="Simpsons">
                        <Store>
                            <ext:Store runat="server" DataSource="<%# Data %>" AutoDataBind="true" Width="500">
                                <Fields>
                                    <ext:ModelField Name="name" />
                                    <ext:ModelField Name="email" />
                                    <ext:ModelField Name="phone" />
                                </Fields>
                            </ext:Store>
                        </Store>
                        <Columns>
                            <ext:Column runat="server" Text="Name" DataIndex="name" Width="100" />
                            <ext:Column runat="server" Text="Email" DataIndex="email" Width="210" />
                            <ext:Column runat="server" Text="Phone" DataIndex="phone" Width="150" />
                        </Columns>
                    </ext:Grid>
                </Items>
            </ext:Viewport>
        </div>
        </form>
    </body>
    </html>
    Sorry again for missing your thread, and hope the answer above fully solves your problem with Ext.NET mobile. If not, please let us know!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] One to many grids
    By registrator in forum 2.x Premium Help
    Replies: 4
    Last Post: May 05, 2015, 10:07 PM
  2. Replies: 2
    Last Post: Aug 07, 2014, 4:56 PM
  3. Render 2 grids
    By LLdeOJ in forum 1.x Help
    Replies: 2
    Last Post: Jan 26, 2011, 10:06 AM
  4. Two Grids get value
    By JsonTerre in forum 1.x Help
    Replies: 0
    Last Post: Mar 10, 2009, 12:04 AM
  5. DnD Between 2 Grids
    By davidhoyt in forum 1.x Premium Help
    Replies: 1
    Last Post: Jan 13, 2009, 3:02 AM

Posting Permissions