PDA

View Full Version : مبتدی: تغییر رنگ یک سطر در Grideview بر اساس یک شرط خاص در یک ستون در زبان #C



Mazloomy
چهارشنبه 21 اردیبهشت 1390, 12:15 عصر
با سلام و امید نیک روزی برای دوستان برنامه نویس
برای موضوع این تاپیک خیلی جستجو کردم، تا به نتیجه زیر رسیدم. آن را در اینجا قرار می دم شاید برای بعضی ها که مثل من مبتدی هستند، مفید باشد.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) // Use This Event From Properties/Event/Data of your GridView
}

if (e.Row.RowType == DataControlRowType.DataRow) //Control RowType is Data
}

if (checkEpireDate(e.Row.Cells[Column index].Text))// Check Condition
e.Row.BackColor = System.Drawing.Color.Red;// This will make row back color red

{
{