Solved

report grid view  back ground coloring problem

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Gridview selected row 9 44
How can my static class become undefined?? 8 47
ASP.NET gridview select textbox on focus 2 33
imap mails 1 22
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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