Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:GridView ID="grdEmployeePeripheral" runat="server"
                                    AutoGenerateColumns="False" BackColor="White" BorderColor="#999999"
                                    BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical"
                                    HorizontalAlign="Center"
                                    onrowdatabound="grdEmployeePeripheral_RowDataBound">
                                    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                    <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                                    <Columns>

                                        <asp:BoundField DataField="PeripheralType" HeaderText="PeripheralType"
                                            SortExpression="PeripheralType" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Specification" HeaderText="Specification"
                                            SortExpression="Specification" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                          <asp:BoundField DataField="Remarks" HeaderText="Remarks"
                                            SortExpression="Remarks" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                          <asp:BoundField DataField="Warrenty" HeaderText="Warrenty"
                                            SortExpression="Warrenty" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                         <asp:BoundField DataField="PurchaseDate" HeaderText="Purchase Date"
                                            SortExpression="PurchaseDate" DataFormatString="{0:dd-MMM-yyyy}" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                         <asp:BoundField DataField="PeripheralAssignDate" HeaderText="Peripheral AssignDate"
                                            SortExpression="PeripheralAssignDate" DataFormatString="{0:dd-MMM-yyyy}" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>

                                    </Columns>
                                    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                                    <AlternatingRowStyle BackColor="#DCDCDC" />
                                </asp:GridView>
Posted
Comments
jinnatara 27-Mar-13 6:22am    
I want to highlight warranty field when its warranty is expired. And it will be related with purchase date Column.Suppose one product buy about 6 months ago. its warrenty 6 months. it will bw red color when warrenty expired.

forecolour:"xxxxx" place this where ever u need to change colours..

SIMPLE
 
Share this answer
 
You've got solution here: How to give cell forecolour in a griedview using two columns value in condition[^]

Please, do not repost! If you have any question, use "Have a Question or Comment" widget.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900