Solved

report grid view  back ground coloring problem

Posted on 2011-09-14
4
258 Views
Last Modified: 2012-05-12
i am using report grid view trying to change background
it works fine but when the record is the last in page
it is not colored
????
any help
??????/
<cc1:ReportGridView ID="GridView2" runat="server" AllowSorting="True" 
                    BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px"
                    CellPadding="6" ForeColor="Black" GridLines="Vertical" 
            AutoGenerateColumns="False" Width="100%" CssClass="tblGrid  smallSize"  DataKeyNames="PostOfficeCode"
                     AllowPrintPaging="True" PageSize="10" PrintPageSize="10" onrowdatabound="GridView1_RowDataBound" 
                  >
                 
                 <RowStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
                 
                 
                  <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                   
                   
                       <Columns>
           
                   
                      
                       <asp:TemplateField HeaderText="¿¿¿¿¿¿">
            <ItemTemplate>
                <%# Eval("Customer_NameAr")%>
              
            
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
           
           
                    <asp:TemplateField HeaderText="¿¿¿ ¿¿¿¿¿¿">
            <ItemTemplate>
                <%# Eval("UserName")%>
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
        
        
        
        
     
      
                    
        <asp:TemplateField HeaderText="¿¿¿¿¿¿">
            <ItemTemplate>
                <%# Eval("Depositor_Name")%>
              
            
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
        
        
         <asp:TemplateField HeaderText="¿¿¿¿¿ ¿¿¿¿¿">
            <ItemTemplate>
                <%# Eval("Transaction_ChangeFees", "{0:n}")%>
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
        
         <asp:TemplateField HeaderText="¿¿¿¿ ¿¿¿¿¿¿ ">
            <ItemTemplate>
                <%# Eval("Transaction_BigFees", "{0:n}")%>
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
       
     
       
        <asp:TemplateField HeaderText="¿¿¿¿¿¿ ¿¿¿¿¿">
            <ItemTemplate>
                <%# Eval("Transaction_ChangeValue", "{0:n}")%>
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
      
       <asp:TemplateField HeaderText="¿¿¿¿¿¿ ¿¿¿¿¿¿">
            <ItemTemplate>
                <%# Eval("Transaction_BigValue", "{0:n}")%>
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField> 
      
   
        
        
     
      
                    
                        <asp:TemplateField HeaderText="¿¿¿¿ ¿¿¿¿ ¿¿¿¿¿¿¿">
            <ItemTemplate>
                <%# Eval("Transaction_NetAmount", "{0:n}")%>
              
            
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
   
        
            <asp:TemplateField HeaderText=" ¿¿¿¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿¿¿¿¿¿ ">
            <ItemTemplate>
                <%# Eval("Transaction_TotalFees", "{0:n}")%>
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
        
           <asp:TemplateField HeaderText="¿¿¿¿¿¿ ¿¿¿¿¿¿¿ ">
            <ItemTemplate>
                <%# Eval("Transaction_TotalValue", "{0:n}")%>
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
         <asp:TemplateField HeaderText="¿¿¿¿¿¿¿¿">
            <ItemTemplate>
                <%# Eval("PayementOrder_Group")%>
              
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
      
        
        
        <asp:TemplateField HeaderText="¿¿¿ ¿¿¿ ¿¿¿¿¿ ">
            <ItemTemplate>
                <%# Eval("PaymentOrder_sequence")%>
              
              
            
            </ItemTemplate>
             <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
        
       <asp:TemplateField HeaderText="¿¿¿¿¿ ¿¿¿¿¿¿¿ ">
            <ItemTemplate>
                <%# Eval("Transaction_DateTime")%>
              
            
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="¿¿¿ ¿¿¿¿¿¿ " >
            <ItemTemplate>
                <%# Eval("PostOfficeCode")%>
              
            
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Right" />
        </asp:TemplateField>
        
        <asp:TemplateField HeaderText="¿¿¿¿ ¿¿¿¿">
            <ItemTemplate>
                <%# Eval("PostOfficeName")%>
              
            
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Right" />
            
        </asp:TemplateField>
      <asp:TemplateField HeaderText="¿¿¿¿¿  ¿¿¿¿">
            <ItemTemplate>
                <%# Eval("PostOfficeArea")%>
              
            
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Right" />
            
        </asp:TemplateField>
      
      
               
                    </Columns>
                   
                    <SelectedRowStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
                   
                   <PageFooterTemplate>
<br />                   
                
            ¿¿¿¿ 
                   <%#  GridView2.PrintPageCount == 0 ? "0" : GridView2.CurrentPrintPage.ToString()%>
                ¿¿ ¿¿¿ 
                <%# GridView2.PrintPageCount%>

<br />
<%# this.Title %>
<br />
<br />
               <hr />
         <br />
         <br />       
            </PageFooterTemplate>
           
                    <HeaderStyle BackColor="#cccccc" Font-Bold="True" ForeColor="Black" 
                        Font-Size="11px" BorderStyle="Solid"  
                        BorderColor="Black" BorderWidth="1px" />
                    <AlternatingRowStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
                </cc1:ReportGridView>

Open in new window

for (int i = 0; i < GridView2.Rows.Count; i++)
        {
            DataKey _key = GridView2.DataKeys[i];
            if (i % 10 == 0)
            {
                string stttt = "";

            }
            if (_key.Values[0].ToString().Contains("¿¿¿¿¿¿ ¿¿¿¿"))
            {
                GridView2.Rows[i].BackColor = System.Drawing.Color.Yellow;//office total

            }

            if (_key.Values[0].ToString().Contains("¿¿¿¿¿¿ ¿¿¿¿¿"))
            {
                GridView2.Rows[i].BackColor = System.Drawing.Color.Gray;//area total
                //  GridView2.Rows[i].ForeColor = System.Drawing.Color.Black;

            }

            if (_key.Values[0].ToString().Contains("¿¿¿¿¿¿ ¿¿¿¿¿"))
            {
                GridView2.Rows[i].BackColor = System.Drawing.Color.Gray;//area total
                //GridView2.Rows[i].ForeColor = System.Drawing.Color.Black;

            }

Open in new window

0
Comment
Question by:AhmedHindy
  • 3
4 Comments
 
LVL 35

Expert Comment

by:Miguel Oz
ID: 36540759
Where is the code behind executed (e.g Page_load)?
What is the GridView1_RowDataBound implementation?
How is the binding done?
0
 
LVL 4

Accepted Solution

by:
AhmedHindy earned 0 total points
ID: 36556439
Code that worked for me :
0
 
LVL 4

Author Closing Comment

by:AhmedHindy
ID: 36585511
worked for me
0
 
LVL 4

Author Comment

by:AhmedHindy
ID: 36556463
worked
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now