protected void rgAsignarCompetencias_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridEditableItem && e.Item.IsInEditMode) { (e.Item as GridEditableItem)["COMPETENCIA_PUESTO_VALOR_REQUERIDO"].Visible = false; (e.Item as GridEditableItem)["ESTADO_EVALUACION"].Visible = false; } if (hf_Estado.Value == BE_EVALUACION_COMPETENCIA_PUESTO.ESTADO_EVALUACION.Evaluado.ToString() && Session["PERFIL_ID"].ToString() == "2") { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; ImageButton imageButton = (ImageButton)item["EditCommandColumn"].Controls[0]; imageButton.Visible = false; } } if (e.Item is GridPagerItem) { GridPagerItem pagerItem = e.Item as GridPagerItem; int itemsCount = pagerItem.Paging.DataSourceCount; if (itemsCount > 0) { if (hf_Estado.Value == BE_EVALUACION_COMPETENCIA_PUESTO.ESTADO_EVALUACION.Evaluado.ToString() && Session["PERFIL_ID"].ToString() == "2") { btnGuardarEvaluacionFinal.Visible = false; } else { btnGuardarEvaluacionFinal.Visible = true; } } } }
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridPagerItem) { GridPagerItem gpi = e.Item as GridPagerItem; LinkButton lb = gpi.FindControl("Prev") as LinkButton; lb.CommandName = "Page"; lb.CommandArgument = "Prev"; lb.Text = "<="; if (gpi.NamingContainer is GridTHead) { (gpi.FindControl("Prev") as LinkButton).Text += "**"; } if (gpi.NamingContainer is GridTFoot) { (gpi.FindControl("Prev") as LinkButton).Text = "**" + (gpi.FindControl("Prev") as LinkButton).Text; } lb = gpi.FindControl("Next") as LinkButton; lb.CommandName = "Page"; lb.CommandArgument = "Next"; lb.Text = "=>"; } }
public void SetAdvancedPagerStyle(GridPagerItem item) { //Traduce el Pager del RadGrid y asigna tooltips Label goToPageLabel = item.FindControl("GoToPageLabel") as Label; Label pageOfLabel = item.FindControl("PageOfLabel") as Label; RadNumericTextBox changePageSizeTextBox = item.FindControl("ChangePageSizeTextBox") as RadNumericTextBox; RadNumericTextBox goToPageTextBox = item.FindControl("GoToPageTextBox") as RadNumericTextBox; Button goToPageLinkButton = item.FindControl("GoToPageLinkButton") as Button; Button changePageSizeLinkButton = item.FindControl("ChangePageSizeLinkButton") as Button; if (goToPageLabel != null) goToPageLabel.Text = "Página:"; if (pageOfLabel != null) pageOfLabel.Text = "de " + item.Paging.PageCount.ToString(string.Format("n0")); if (changePageSizeTextBox != null) { changePageSizeTextBox.MaxValue = 1000; changePageSizeTextBox.Attributes.Add("data-toggle", "tooltip"); } if (goToPageTextBox != null) goToPageTextBox.Attributes.Add("data-toggle", "tooltip"); if (goToPageLinkButton != null) { goToPageLinkButton.Text = "Ver"; goToPageLinkButton.CssClass = changePageSizeLinkButton.CssClass = "btn btn-primary btn-sm"; goToPageLinkButton.Attributes.Add("data-toggle", "tooltip"); } if (changePageSizeLinkButton != null) { changePageSizeLinkButton.Text = "Cambiar"; changePageSizeLinkButton.Attributes.Add("data-toggle", "tooltip"); } }
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridPagerItem) { GridPagerItem gridPager = e.Item as GridPagerItem; Control numericPagerControl = gridPager.GetNumericPager(); Control placeHolder = gridPager.FindControl("NumericPagerPlaceHolder"); placeHolder.Controls.Add(numericPagerControl); } }
public void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridCommandItem) { GridCommandItem commandItem = (e.Item as GridCommandItem); PlaceHolder container = (PlaceHolder)commandItem.FindControl("PlaceHolder1"); Label label = new Label(); label.Text = " "; container.Controls.Add(label); for (int i = 65; i <= 65 + 25; i++) { LinkButton linkButton1 = new LinkButton(); LiteralControl lc = new LiteralControl(" "); linkButton1.Text = "" + (char)i; linkButton1.CommandName = "alpha"; linkButton1.CommandArgument = "" + (char)i; container.Controls.Add(linkButton1); container.Controls.Add(lc); } LiteralControl lcLast = new LiteralControl(" "); container.Controls.Add(lcLast); LinkButton linkButtonAll = new LinkButton(); linkButtonAll.Text = "All"; linkButtonAll.CommandName = "NoFilter"; container.Controls.Add(linkButtonAll); } else if (e.Item is GridPagerItem) { GridPagerItem gridPager = e.Item as GridPagerItem; Control numericPagerControl = gridPager.GetNumericPager(); Control placeHolder = gridPager.FindControl("NumericPagerPlaceHolder"); placeHolder.Controls.Add(numericPagerControl); } else if (e.Item is GridNestedViewItem) { var nestedItem = (GridNestedViewItem)e.Item; var hdnEmail = (HiddenField)nestedItem.FindControl("hdnEmail"); hdnEmail.Value = nestedItem.ParentItem["Email"].Text; var lvOrder = (RadListView)nestedItem.FindControl("lvOrder"); var OdsOrder = (ObjectDataSource)nestedItem.FindControl("OdsOrder"); lvOrder.DataSourceID = OdsOrder.ID; } }
protected void RadGrid1_OnItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridPagerItem) { GridPagerItem pagerItem = (GridPagerItem)e.Item; RadComboBox PageSizeCombo = (RadComboBox)pagerItem.FindControl("PageSizeComboBox"); RadComboBoxItem item1 = new RadComboBoxItem(); item1 = new RadComboBoxItem("All", int.MaxValue.ToString()); item1.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); PageSizeCombo.Items.Add(item1); } }
public void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridCommandItem) { GridCommandItem commandItem = (e.Item as GridCommandItem); PlaceHolder container = (PlaceHolder)commandItem.FindControl("PlaceHolder1"); Label label = new Label(); label.Text = " "; container.Controls.Add(label); for (int i = 65; i <= 65 + 25; i++) { LinkButton linkButton1 = new LinkButton(); LiteralControl lc = new LiteralControl(" "); linkButton1.Text = "" + (char)i; linkButton1.CommandName = "alpha"; linkButton1.CommandArgument = "" + (char)i; container.Controls.Add(linkButton1); container.Controls.Add(lc); } LiteralControl lcLast = new LiteralControl(" "); container.Controls.Add(lcLast); LinkButton linkButtonAll = new LinkButton(); linkButtonAll.Text = "Tất cả"; linkButtonAll.CommandName = "NoFilter"; container.Controls.Add(linkButtonAll); } else if (e.Item is GridPagerItem) { GridPagerItem gridPager = e.Item as GridPagerItem; Control numericPagerControl = gridPager.GetNumericPager(); Control placeHolder = gridPager.FindControl("NumericPagerPlaceHolder"); placeHolder.Controls.Add(numericPagerControl); } }