protected void grdForecastReconciliation_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.Cells.Count > 1) { HideGridColumns(e); if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[grdForecastReconciliation.FindColumnIndex("Adjustment_TD")].BackColor = Color.LightCyan; e.Row.Cells[grdForecastReconciliation.FindColumnIndex("Adjustment_BU1")].BackColor = Color.LightSkyBlue; e.Row.Cells[grdForecastReconciliation.FindColumnIndex("Adjustment_BU2")].BackColor = Color.LightGray; Table tbl = (Table)grdForecastReconciliation.Controls[0]; int newRowIndex = tbl.Rows.Count - 1; ForecastAdjustmentEntity ForecastReconciliation = (ForecastAdjustmentEntity)e.Row.DataItem; if ((ForecastReconciliation.CMSPool.PoolDescription != currentPool) && (currentPool != string.Empty)) //if new item and not first row { //reset current pool currentPool = ForecastReconciliation.CMSPool.PoolDescription; } else { //if (currentPool != string.Empty) // e.Row.Cells[0].Text = ""; //else // currentPool = ForecastReconciliation.CMSPool.PoolDescription; } } } }
protected void grdForecastAdjustment_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.Cells.Count > 1) { HideGridColumns(e); if (e.Row.RowType == DataControlRowType.DataRow) { //e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand'; this.style.backgroundColor='ActiveBorder';"); //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';"); //e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackClientHyperlink(this.grdForecastAdjustment, "Select$" + e.Row.RowIndex)); Table tbl = (Table)grdForecastAdjustment.Controls[0]; int newRowIndex = tbl.Rows.Count - 1; ForecastAdjustmentEntity forecastadjustment = (ForecastAdjustmentEntity)e.Row.DataItem; if ((forecastadjustment.CMSPool.PoolDescription != currentPool) && (currentPool != string.Empty)) //if new item and not first row { //reset current pool currentPool = forecastadjustment.CMSPool.PoolDescription; } else { //if (currentPool != string.Empty) // e.Row.Cells[0].Text = ""; //else // currentPool = forecastadjustment.CMSPool.PoolDescription; } } } }