Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

report grid view  back ground coloring problem

Posted on 2011-09-14
4
Medium Priority
?
268 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

704 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