protected void GridInvoiceRowDataBound(Object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//if (Convert.ToInt64(DataBinder.Eval(e.Row.DataItem, "I_TP_Status")) == 1)
//{
if (Convert.ToInt16(DataBinder.Eval(e.Row.DataItem, "I_KIA_Statuss")) == 1)
{
//e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#D3D3D3");
e.Row.Font.Bold = true;
//e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#f7e405");
e.Row.Cells[13].BackColor = System.Drawing.ColorTranslator.FromHtml("#f7e405");
}
else
{
if (Convert.ToInt16(DataBinder.Eval(e.Row.DataItem, "I_TP_Status")) == 0)
{
//e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#D3D3D3");
e.Row.Font.Bold = true;
//e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#f7e405");
e.Row.Cells[13].BackColor = System.Drawing.ColorTranslator.FromHtml("#f7e405");
}
else if (Convert.ToInt16(DataBinder.Eval(e.Row.DataItem, "I_TP_Status")) == 3)
{
//e.Row.Font.Bold = true;
// e.Row.Cells[18].BackColor = System.Drawing.Color.Green;
e.Row.Cells[13].BackColor = System.Drawing.ColorTranslator.FromHtml("#ea9797");
//e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#ea9797");
}
else
{
//e.Row.Font.Bold = true;
// e.Row.Cells[18].BackColor = System.Drawing.Color.Green;
e.Row.Cells[13].BackColor = System.Drawing.ColorTranslator.FromHtml("#83f383");
//e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#83f383");
// Create Covering Letter
if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "I_KIA_Cover_Status")) == "")
{
e.Row.Cells[16].BackColor = System.Drawing.ColorTranslator.FromHtml("#f7e405");
}
else
{
//e.Row.Cells[15].BackColor = System.Drawing.ColorTranslator.FromHtml("#83f383");
e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#83f383");
// For upload and view Letter
//if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "I_KIA_InvoiceUpload")) == "")
//{
// e.Row.Cells[19].BackColor = System.Drawing.ColorTranslator.FromHtml("#ea9797");
//}
//else
//{
// e.Row.Cells[19].BackColor = System.Drawing.ColorTranslator.FromHtml("#83f383");
//}
}
}
}
}
}
-------------------------------------
protected void grd_Batch_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow && grd_Batch.EditIndex == e.Row.RowIndex)
{
DropDownList ddl_district = (DropDownList)e.Row.FindControl("ddl_district");
DataTable dt = null;
try
{
dt = obj.DistrictShow(drp_state.SelectedIndex > 0 ? Convert.ToInt32(drp_state.SelectedValue) : 0);
if (dt != null)
{
ddl_district.DataSource = dt;
ddl_district.DataTextField = "District_Name";
ddl_district.DataValueField = "District_ID";
ddl_district.DataBind();
ddl_district.Items.Insert(0, new ListItem("--Select District--", "0"));
string selectedCity = DataBinder.Eval(e.Row.DataItem, "District_Name").ToString();
ddl_district.Items.FindByText(selectedCity).Selected = true;
}
else
{
ddl_district.Items.Insert(0, new ListItem("--Select District--", "0"));
}
}
catch (SqlException ex)
{
ExceptionHandler.WriteException(ex.Message);
}
catch (Exception ex)
{
ExceptionHandler.WriteException(ex.Message);
}
finally
{
if (dt != null)
{
dt.Dispose();
}
}
}
}
---------------------------------------------
protected void grdTPBatchDetails_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowType != null)
{
RadioButtonList rblShippers = (RadioButtonList)e.Row.FindControl("rblist");
//hfld
HiddenField hf = (HiddenField)e.Row.FindControl("hfld");
ImageButton imb = (ImageButton)e.Row.FindControl("ImgSave");
TextBox remrk = (TextBox)e.Row.FindControl("lbl_remarks") as TextBox;
if (Convert.ToInt32(hf.Value.ToString()) == 2)
{
rblShippers.SelectedIndex = 0;
rblShippers.Enabled = false;
imb.Enabled = false;
remrk.Enabled = false;
}
else if (Convert.ToInt32(hf.Value.ToString()) == 3)
{
rblShippers.SelectedIndex = 1;
imb.Enabled = false;
remrk.Enabled = false;
}
else
{
rblShippers.SelectedIndex = -1;
}
}
}
No comments:
Post a Comment