[CLOSED] Large amount of text in GridPanel

  1. #1

    [CLOSED] Large amount of text in GridPanel

    Hi.

    I have a gridpanel with a "details" column that can contain a large amount of text. Can I set the grid column to wrap to show all of this text (with an expander control would be even better but not essential). I can do a "details" window but just wanted something simpler..

    Thanks
    Last edited by Daniil; May 31, 2011 at 10:52 AM. Reason: [CLOSED]
  2. #2
    Hi,

    It requires
    white-space: normal;
    for grid cells.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test1", "test test test test test test test test test test test test test test test test" },
                    new object[] { "test2", "test test test test test test test test test test test test test test test test" },
                    new object[] { "test3", "test test test test test test test test test test test test test test test test" }
                };
                store.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    
        <style type="text/css">
            .my-grid .x-grid3-cell-inner {
                white-space: normal;
            }
        </style>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:GridPanel 
            ID="GridPanel1" 
            runat="server" 
            AutoHeight="true" 
            Cls="my-grid">
            <Store>
                <ext:Store runat="server">
                    <Reader>
                        <ext:ArrayReader>
                            <Fields>
                                <ext:RecordField Name="test1" />
                                <ext:RecordField Name="test2" />
                            </Fields>
                        </ext:ArrayReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column Header="Test1" DataIndex="test1" />
                    <ext:Column Header="Test2" DataIndex="test2" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
        </form>
    </body>
    </html>
  3. #3
    Ah, I see, thanks! I didn't know you could apply a "Cls" to the Grid to customise the css classes - thats great!
  4. #4
    See also
    https://examples1.ext.net/#/GridPane...ous/Custom_UI/

    Generally speaking, we can apply custom css for everything in Ext.Net.
  5. #5
    The thread is related to this one:
    http://forums.ext.net/showthread.php?3222

Similar Threads

  1. GridPanel Sql Paging For large Datasets
    By ismailkocacan in forum Examples and Extras
    Replies: 17
    Last Post: Aug 09, 2015, 10:47 AM
  2. Layout of large amount of UI elments
    By fangmdu in forum 2.x Help
    Replies: 1
    Last Post: Jul 02, 2012, 11:25 PM
  3. [CLOSED] GridPanel Loading with Large Data Set
    By bethc in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 28, 2009, 2:20 PM
  4. [CLOSED] GridPanel cannot get a big amount of data
    By acrossdev in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 09, 2009, 8:21 AM
  5. Replies: 8
    Last Post: Sep 06, 2008, 7:02 PM

Tags for this Thread

Posting Permissions