Gridview’da satır içi değere bakıp farkı arka plan rengi verme olayı
protected void GrdFaaliyetler_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string al = e.Row.Cells[9].Text;
if (!string.IsNullOrEmpty(al))
{
if (al == “false” || al == “False”)
e.Row.BackColor = System.Drawing.Color.Red;
}
}
}
Diğer satır özelliklerini değiştirmek için;
if (e.RowType == GridViewRowType.Data)
{
if (((ASPxGridView)sender).GetRowValues(e.VisibleIndex, “distFillStatus”).ToString() == “REJECTED”)
{
e.Row.BackColor = System.Drawing.Color.Red;
e.Row.ForeColor = System.Drawing.Color.White;
//e.Row.Font.Size = 15;
//e.Row.Font.Bold = true;
//e.Row.Attributes.Add(“style”, “background-color: red; fore-color: white;”);
}
}
About Post Author
Sayfa Yoneticisi
Daha fazla
grid satırlarına satır numarası vermek
select ROW_NUMBER() OVER(ORDER BY SutunAdi) AS SIRA, * from tablo
asp.net inline matematiksel işlemler
<%#Eval("TFSP")%><%#Eval("TFSG")%><%# Math.Floor(Convert.ToDecimal(Eval("TFSG")) / (Convert.ToDecimal(Eval("TFSP")) > 0 ? Convert.ToDecimal(Eval("TFSP")):1)*100)%><%#Eval("TKSP")%><%#Eval("TKSG")%><%# Math.Floor(Convert.ToDecimal(Eval("TKSG")) / (Convert.ToDecimal(Eval("TKSP")) > 0 ? Convert.ToDecimal(Eval("TKSP")):1)*100)%>
asp.net System.Windows.Forms.MessageBox.Show hatası durumunda
If you are using MS Visual Studio:Right click on the ProjectSelect "Add Reference..."Navigate to the ".NET" tabFind "System.Windows.Forms" and select...
Tek onclick olayı ile iki kontrol
protected void LinkButton_Click(object sender, EventArgs e) { bool al = pnl.Visible; ...
Veritabanına insert işlemi esnasında son girilen kaydın id değerini almak
SqlCommand cmd = new SqlCommand("insert into tablo(alan1,alan2) VALUES(alan1,alan2) ; select scope_identity() ", baglanti); ...
ASP.Net Calendar – Takvim Day render olayları
protected void CalendarTarih2_DayRender(object sender, DayRenderEventArgs e) { if (CalendarTarih1.SelectedDate <= e.Day.Date...