Solved

report grid view  back ground coloring problem

Posted on 2011-09-14
4
263 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 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