Solved

report grid view  back ground coloring problem

Posted on 2011-09-14
4
264 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 36

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change to file doesn't show up 16 93
asp web application 3 55
Json and ajax 1 44
async questions 5 48
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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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