private void SaveMerhcandisingGroupCustomLink() { MerchandisingGroupCustomLink.DeleteMerchandisingGroupCustomLinkByMerchandisingGroupCustomId(this.merchandisingGroupCustomId); MerchandisingGroupCustomLink merchandisingGroupCustomLink = null; foreach (GridViewRow gridViewRow in GridViewResult.Rows) { merchandisingGroupCustomLink = new MerchandisingGroupCustomLink(); HiddenField hiddenFieldStoreCategoryId = (HiddenField)gridViewRow.Cells[0].FindControl("HiddenFieldStoreCategoryId"); CheckBox checkBoxLink = (CheckBox)gridViewRow.Cells[5].FindControl("CheckBoxStoreCategoryLink"); if (checkBoxLink.Checked) { merchandisingGroupCustomLink.MerchandisingGroupCustomId = this.merchandisingGroupCustomId; merchandisingGroupCustomLink.StoreCategoryId = Convert.ToInt32(hiddenFieldStoreCategoryId.Value); merchandisingGroupCustomLink.ModifiedUser = this.Master.LoggedOnAccount; merchandisingGroupCustomLink.Save(); } } }
protected void GridViewResult_RowDataBound(object sender, GridViewRowEventArgs e) { GridViewRow currentRow = e.Row; if (currentRow.RowIndex == 0) { previousGridViewResult = (Object)currentRow.DataItem; } if (currentRow.RowIndex > 0) { //if (this.storeId > 0) //{ MerchandisingGroupCustomLink previousStoreCategory = (MerchandisingGroupCustomLink)previousGridViewResult; MerchandisingGroupCustomLink currentStoreCategory = (MerchandisingGroupCustomLink)currentRow.DataItem; if (previousStoreCategory.StoreCategoryGroup == currentStoreCategory.StoreCategoryGroup) { currentRow.Cells[3].ForeColor = System.Drawing.Color.White; currentRow.Cells[2].Text = String.Empty; } previousGridViewResult = (Object)currentStoreCategory; //} //else //{ // EmployeeStoreCategory previousStoreCategory = (EmployeeStoreCategory)previousGridViewResult; // EmployeeStoreCategory currentStoreCategory = (EmployeeStoreCategory)currentRow.DataItem; // if (previousStoreCategory.StoreCategoryGroup == currentStoreCategory.StoreCategoryGroup) // { // currentRow.Cells[3].ForeColor = System.Drawing.Color.White; // currentRow.Cells[2].Text = String.Empty; // } // previousGridViewResult = (Object)currentStoreCategory; //} } }
private void BindGridViewResult() { GridViewResult.DataSource = MerchandisingGroupCustomLink.GetMerchandisingGroupCustomLinkListByMerchandisingGroupCustomId(this.merchandisingGroupCustomId); GridViewResult.DataBind(); }