Vertical layout in GridPanel

Page 1 of 2 12 LastLast
  1. #1

    Vertical layout in GridPanel

    How do I display a GridPanel in vertical orientation with 2 columns?
    For example, here is a table with 2 columns and many rows. I need to position GridPanel like this table.

    <table>
      <tr>
            <td>First row header</td>
            <td>First row data data data data</td>
     </tr>
     <tr>
            <td>Second row header</td>
            <td>Second row data data data data</td>
     </tr>
    <tr>
            <td>Third row header</td>
            <td>Third row data data data data</td>
     </tr>
    <tr>
            <td>Fouth row header</td>
            <td>Fouth row data data data data</td>
     </tr>
    </table>
    Last edited by AlexMaslakov; Aug 10, 2011 at 12:11 PM.
  2. #2
    Hi,

    Unfortunately, there is no such functionality in GridPanel.

    Not sure but, maybe, you need PropertyGrid.
    https://examples1.ext.net/#/Property...asic/Overview/
  3. #3
    it looks good. Perhaps, I'll use it.
  4. #4
    <ext:Store ID="myStore" runat="server" />
    <ext:PropertyGrid ID="PropertyGrid1" runat="server" Width="600" AutoHeight="true" StoreID="myStore"
        Editable="false">
        <Source>
            <ext:PropertyGridParameter Name="Name1"   />
            <ext:PropertyGridParameter Name="Name2" />
            <ext:PropertyGridParameter Name="Name3" />
            <ext:PropertyGridParameter Name="Name4" />
        </Source>
        <View>
            <ext:GridView ForceFit="true" ScrollOffset="2" runat="server" />
        </View>
    </ext:PropertyGrid>
    
    
    
    protected void Page_Init(object sender, EventArgs e)
            {
    
                myStore.DataSource = GetData();
                myStore.DataBind();
    
            }
    
            private DataTable GetData()
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("Name1");
                dt.Columns.Add("Name2");
                dt.Columns.Add("Name3");
                dt.Columns.Add("Name4");
                dt.Rows.Add("name-data-11", "name-data-22", "name-data-33", "name-data-44");
                return dt;
            }
    How do I map <ext:PropertyGridParameter Name="Name1" /> to "Name1" of myStore (DataTable) ?
  5. #5
    PropertyGrid doesn't use a store
    Just use Source property (set of items (Name/Value pair))
  6. #6
    Source have no setter property. You, probably, mean SetSource() method.
    Thanks, it works as I want.
  7. #7
    You don't need setter for Source, it is ready to use collection, just add to Source own parameters
  8. #8
    How?

     Tuple<decimal, decimal, decimal, decimal, decimal, decimal> financeInfo = GetFinance();
    
                PropertyGrid1.SetSource(
                     new PropertyGridParameterCollection
                       {
                          new PropertyGridParameter("title1", financeInfo.Item1.ToString()),
                           new PropertyGridParameter("title2", financeInfo.Item2.ToString()),
                           new PropertyGridParameter("title3", financeInfo.Item3.ToString()),
                           new PropertyGridParameter("title4", financeInfo.Item4.ToString()),
                           new PropertyGridParameter("title5", financeInfo.Item5.ToString()),
                           new PropertyGridParameter("title6", financeInfo.Item6.ToString())
                     }
          );
    Is there another way to do it?
  9. #9
    Please use:
    PropertyGrid1.Source.Add(new PropertyGridParameter("name", "value"));
  10. #10
    What's the difference between

    PropertyGrid1.Source.Add(new PropertyGridParameter("name", "value"));
    and

     PropertyGrid1.SetSource( new PropertyGridParameterCollection  {  new PropertyGridParameter("name", "value")  });
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: Jul 18, 2011, 8:40 AM
  2. [CLOSED] Two column layout with vertical scroll bar
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 26, 2011, 10:28 PM
  3. [CLOSED] Vertical Button With Text, Or Vertical Tabs
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 21, 2011, 9:43 PM
  4. Replies: 3
    Last Post: Sep 13, 2010, 4:13 PM
  5. Replies: 4
    Last Post: Dec 30, 2009, 1:31 AM

Posting Permissions