Let's see the gridView:-
I likes to have BackColor to the column- SELECT and DELETE.
I just tried a coding for this. Here the code
protected void dgvMovie_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[4].Text == "Select")
{
e.Row.BackColor = System.Drawing.Color.LightBlue;
}
if (e.Row.Cells[5].Text == "Delete")
{
e.Row.BackColor = System.Drawing.Color.LightBlue;
}
}
}
So If the code have logical error, please rectify it.

Vishwas Kadamannaya111 reputationPosted Aug 19, 2013, 9:00 PM EDT
I believe this e.Row.Cells[4].Text == "Select" wont work as it seems to link button and not a free cell text.
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 19, 2013, 9:07 PM EDT
Set the style directly in your GRIDVIEW for those column
Regards,
Iftikar
Bineesh ViswanathRank #1,681 · 907 reputationPosted Aug 19, 2013, 9:18 PM EDT
I likes to know from you:-
1) what is meant by RowDataBound event?
2) In which situations, this became useful?
3) is learning this event would be very useful in our future?
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 19, 2013, 9:20 PM EDT
in aspx:
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 19, 2013, 9:21 PM EDT
Before the GridView control can be rendered, each row in the control must be bound to a record in the data source. The RowDataBound event is raised when a data row (represented by a GridViewRow object) is bound to data in the GridView control. This enables you to provide an event-handling method that performs a custom routine, such as modifying the values of the data bound to the row, whenever this event occurs.
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 19, 2013, 9:23 PM EDT
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx
and read it from REMARK.
all are important to read as a developer. you have to know all the things.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts