[CLOSED] Change the Font style to Bold for a Row in Grid View

  1. #1

    [CLOSED] Change the Font style to Bold for a Row in Grid View

    Hi:

    I have 10 rows in that I have to show 5 rows with Bolded text, how can i do it, the row is not shown in bold, but the color changes, pls help me on this

    
    <ext:GridView>
                                        <GetRowClass Fn="ValidateSupplierMatches" />
                                    </ext:GridView>
    
      .samesupplier
            {
                color: #f00;
                font-weight:bold;
            }
            
            .diffsupplier
            {
                color: #000;
            }
    Last edited by Daniil; Nov 14, 2011 at 4:34 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Needs to apply a bit different css rule.

    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" },
                    new object[] { "test2" },
                    new object[] { "test3" },
                    new object[] { "test4" },
                    new object[] { "test5" },
                    new object[] { "test6" },
                    new object[] { "test7" },
                    new object[] { "test8" },
                    new object[] { "test9" },
                    new object[] { "test10" },
                };
                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>
        <script type="text/javascript">
            var getRowClass = function (record, index) {
                return index < 5 ? "less5" : "more5";
            }
        </script>
        <style type="text/css">
            .less5 {
                color : red;
            }
            
            .less5 .x-grid3-cell-inner {
                font-weight: bolder !important;
            }
            
            .more5 {
                color : green;
            }
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
                <Store>
                    <ext:Store runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="test" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Test" DataIndex="test" />
                    </Columns>
                </ColumnModel>
                <View>
                    <ext:GridView runat="server">
                        <GetRowClass Fn="getRowClass" />
                    </ext:GridView>
                </View>
            </ext:GridPanel>
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 8
    Last Post: Dec 20, 2017, 1:52 PM
  2. Replies: 0
    Last Post: Sep 27, 2011, 10:24 AM
  3. [CLOSED] How to style FieldLabel (set text to bold)
    By jthompson in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 06, 2011, 10:04 PM
  4. [CLOSED] Server Side Menu Item in bold font
    By nirajrdave in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 25, 2011, 11:54 AM
  5. Header Style Bold
    By simonmicheal in forum 1.x Help
    Replies: 0
    Last Post: Aug 19, 2009, 1:12 PM

Posting Permissions