当前位置: 首页>>代码示例>>C#>>正文


C# GridViewRow.FindControl方法代码示例

本文整理汇总了C#中System.Web.UI.WebControls.GridViewRow.FindControl方法的典型用法代码示例。如果您正苦于以下问题:C# GridViewRow.FindControl方法的具体用法?C# GridViewRow.FindControl怎么用?C# GridViewRow.FindControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.WebControls.GridViewRow的用法示例。


在下文中一共展示了GridViewRow.FindControl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckGridControlPermissions

        protected void CheckGridControlPermissions(GridViewRow row)
        {
            var modifyButton = row.FindControl("imgBtnEdit");

            if (modifyButton != null)
            {
                modifyButton.Visible = PermissionManager.UserHasPermission(this.module, Permissions.Modify);
            }

            var deleteButton = row.FindControl("imgBtnDelete");

            if (deleteButton != null)
            {
                deleteButton.Visible = PermissionManager.UserHasPermission(this.module, Permissions.Remove);
            }
        }
开发者ID:southapps,项目名称:Libraries,代码行数:16,代码来源:GridPage.cs

示例2: GetLeadItemId

        /// <summary>Gets the ID of the lead entry in the given row.</summary>
        /// <param name="row">The row from which to get the lead ID.</param>
        /// <returns>THe ID of the lead in the given row, or <c>null</c> if there isn't a lead in that row</returns>
        private static int? GetLeadItemId(GridViewRow row)
        {
            var hdnLeadId = row.FindControl("hdnLeadId") as HiddenField;

            int leadId;
            if (hdnLeadId != null && int.TryParse(hdnLeadId.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out leadId))
            {
                return leadId;
            }

            return null;
        }
开发者ID:fujinguyen,项目名称:Engage-Employment,代码行数:15,代码来源:JobDetailOptions.ascx.cs

示例3: SetPagerButtonStates

        /// <summary>
        /// Sets the pager button states.
        /// </summary>
        /// <param name="gridView">The grid view.</param>
        /// <param name="gvPagerRow">The gv pager row.</param>
        /// <param name="page">The page.</param>
        public static void SetPagerButtonStates(GridView gridView, GridViewRow gvPagerRow, Page page)
        {
            int pageIndex = gridView.PageIndex;
            int pageCount = gridView.PageCount;

            ImageButton btnFirst = (ImageButton)gvPagerRow.FindControl("btnFirst");
            ImageButton btnPrevious = (ImageButton)gvPagerRow.FindControl("btnPrevious");
            ImageButton btnNext = (ImageButton)gvPagerRow.FindControl("btnNext");
            ImageButton btnLast = (ImageButton)gvPagerRow.FindControl("btnLast");

            btnFirst.Enabled = btnPrevious.Enabled = (pageIndex != 0);
            btnNext.Enabled = btnLast.Enabled = (pageIndex < (pageCount - 1));

            DropDownList ddlPageSelector = (DropDownList)gvPagerRow.FindControl("ddlPages");
            ddlPageSelector.Items.Clear();
            for (int i = 1; i <= gridView.PageCount; i++)
            {
                ddlPageSelector.Items.Add(i.ToString());
            }

            ddlPageSelector.SelectedIndex = pageIndex;

            Label lblPageCount = (Label)gvPagerRow.FindControl("lblPageCount");
            lblPageCount.Text = pageCount.ToString();

            //ddlPageSelector.SelectedIndexChanged += delegate
            //{
            //    gridView.PageIndex = ddlPageSelector.SelectedIndex;
            //    gridView.DataBind();
            //};
        }
开发者ID:JackyW83,项目名称:Test,代码行数:37,代码来源:PresentationUtils.cs

示例4: BuildLookupValueReturnControl

        //Financial_Application.SearchUtility.BankSearch objSl = new SearchUtility.BankSearch();
        public void BuildLookupValueReturnControl(GridViewRow e, string LinkControlId)
        {
            string js;
            string txt;
            HyperLink h1;
            // Label lblMessage;
            //string type;
            if (e.RowType == DataControlRowType.DataRow)
            {
                h1 = (HyperLink)e.FindControl(LinkControlId);
                txt = (string)h1.Text;
                // lblMessage = (Label)e.FindControl(Status);
                // txt1 = (string)lblMessage.Text;
                if (HttpContext.Current.Request.QueryString["setLookupValueToControlID1"] == "")
                {

                    if (HttpContext.Current.Request.QueryString["PostBackParentForm"] != String.Empty)
                    {

                        js = BuildJS_ReturnLookupValue(HttpContext.Current.Request.QueryString["setLookupValueToControlID"], txt, HttpContext.Current.Request.QueryString["PostBackParentForm"], "", "");

                    }
                    else
                    {
                        js = BuildJS_ReturnLookupValue(HttpContext.Current.Request.QueryString["setLookupValueToControlID"], txt, "true", "", "");

                    }
                }
                else
                {
                    if (HttpContext.Current.Request.QueryString["PostBackParentForm"] != String.Empty)
                    {

                        js = BuildJS_ReturnLookupValue(HttpContext.Current.Request.QueryString["setLookupValueToControlID"], txt, HttpContext.Current.Request.QueryString["PostBackParentForm"], HttpContext.Current.Request.QueryString["setLookupValueToControlID1"], e.Cells[2].Text);

                    }
                    else
                    {

                        js = BuildJS_ReturnLookupValue(HttpContext.Current.Request.QueryString["setLookupValueToControlID"], txt, "true", HttpContext.Current.Request.QueryString["setLookupValueToControlID1"], e.Cells[2].Text);

                    }
                    h1.NavigateUrl = "javascript://";
                    //h1.NavigateUrl =
                    h1.Attributes.Add("onclick", js);

                }
            }
        }
开发者ID:chaitu005,项目名称:NSDL,代码行数:50,代码来源:BankSearch.cs

示例5: CustomizeFilesystemColumn

        protected void CustomizeFilesystemColumn(GridViewRow row)
        {
            Label text = row.FindControl("Filesystem") as Label;

            ServiceLock item = row.DataItem as ServiceLock;
            if (text != null && item != null)
                text.Text = item.FilesystemKey == null ? "N/A" : _fsController.LoadFileSystem(item.FilesystemKey).Description;
        }
开发者ID:nhannd,项目名称:Xian,代码行数:8,代码来源:ServiceLockGridView.ascx.cs

示例6: CustomizeLockColumn

        protected void CustomizeLockColumn(GridViewRow row)
        {
            Image img = row.FindControl("LockedImage") as Image;

            ServiceLock item = row.DataItem as ServiceLock;
            if (img != null && item != null)
            {
                img.ImageUrl = item.Lock ? ImageServerConstants.ImageURLs.Checked : ImageServerConstants.ImageURLs.Unchecked;
            }
        }
开发者ID:nhannd,项目名称:Xian,代码行数:10,代码来源:ServiceLockGridView.ascx.cs

示例7: SetLinkButton

 protected void SetLinkButton(GridViewRow gvr, string id, bool enabled)
 {
     LinkButton linkButton = (LinkButton)gvr.FindControl(id);
     linkButton.Enabled = enabled && !isExport;
 }
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:5,代码来源:ListModuleBase.cs

示例8: AddDraftBillJavascriptFunctions

        /// <summary>
        /// Adds the draft bill javascript functions to calculate the billed and unbilled amounts
        /// when the billed amount changes or the bill link is clicked.
        /// </summary>
        /// <param name="gridRow">The grid row.</param>
        private void AddDraftBillJavascriptFunctions(GridViewRow gridRow)
        {
            try
            {
                Control txtBilled = gridRow.FindControl("_txtBilled");
                Control lblUnbilled = gridRow.FindControl("_lblUnBilled");
                Control lblAmount = gridRow.FindControl("_lblAmount");
                Control lnkBtnBill = gridRow.FindControl("_lnkBtnBill");

                if (lblAmount != null && txtBilled != null && lblUnbilled != null && lnkBtnBill != null)
                {
                    TextBox billedAmount = (TextBox)txtBilled;
                    billedAmount.Attributes.Add("onchange", string.Format("CalcUnbilled('{0}','{1}','{2}');",
                                                                lblAmount.ClientID,
                                                                txtBilled.ClientID,
                                                                lblUnbilled.ClientID));

                    LinkButton lnkBill = (LinkButton)lnkBtnBill;
                    lnkBill.Attributes.Add("onclick", string.Format("return Billed('{0}','{1}','{2}');",
                                                                lblAmount.ClientID,
                                                                txtBilled.ClientID,
                                                                lblUnbilled.ClientID));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:advanced-joelloyd,项目名称:UghWebforms,代码行数:34,代码来源:AddDraftBill.aspx.cs

示例9: RowChanged

        public static bool RowChanged(GridViewRow gvr)
        {
            for (var i = 1; i < gvr.Cells.Count - 2; i++)
            {
                var cb = gvr.FindControl("CheckBox" + (i + 8)) as CheckBox;
                if (cb == null)
                {
                    continue;
                }

                if (gvr.Cells[i].BackColor == Color.Blue && !cb.Checked)
                {
                    return true;
                }

                if (cb.Checked)
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:esfdk,项目名称:itubs,代码行数:23,代码来源:CateringListViewModel.cs

示例10: FillForm

 private void FillForm(GridViewRow gridViewRow)
 {
     ValueHiddenField.Value = ((Label)gridViewRow.FindControl("lblUserId")).Text;
     txtTransporter.Text = ((Label)gridViewRow.FindControl("lblTransporterName")).Text;
     txtFirstName.Text = ((Label)gridViewRow.FindControl("lblFirstName")).Text;
     txtLName.Text = ((Label)gridViewRow.FindControl("lblLastName")).Text;
     txtmobile.Text = ((Label)gridViewRow.FindControl("lblMobileNo")).Text;
     txtEmail.Text = ((Label)gridViewRow.FindControl("lblEmail")).Text;
     txtAddress.Text = ((Label)gridViewRow.FindControl("lblAddress")).Text;
     txtCity.Text = ((Label)gridViewRow.FindControl("lblCityName")).Text;
     txtCityId.Text = ((Label)gridViewRow.FindControl("lblCityId")).Text;
     ddlPincode.Enabled = true;
     Fillddl(Convert.ToInt16(txtCityId.Text));
     //ddlPincode.Items.FindByValue(((Label)gridViewRow.FindControl("lblPinCode")).Text).Selected = true;
     var PinId = ((Label)gridViewRow.FindControl("lblPincode")).Text;
     ddlPincode.Items.FindByText(PinId).Selected = true;
 }
开发者ID:mzrokz,项目名称:LssTms,代码行数:17,代码来源:AddTransporter.aspx.cs

示例11: CustomizePartitionStorageConfiguration

 private void CustomizePartitionStorageConfiguration(GridViewRow row)
 {
     ServerPartition partition = row.DataItem as ServerPartition;
     Label lbl = row.FindControl("PartitionStorageConfigurationLabel") as Label; // The label is added in the template
     if (lbl != null)
     {
         if (partition.HasEnabledDeleteRules)
             lbl.Text = Resources.SR.PartitionStorageConfiguration_DeleteRuleExists;
         else
         {
             lbl.Text = partition.ArchiveExists
                     ? Resources.SR.PartitionStorageConfiguration_ArchiveConfiguredNoDeleteRule
                     : Resources.SR.PartitionStorageConfiguration_NoArchiveConfiguredNoDeleteRule;
         }
     }            
 }
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:16,代码来源:ServerPartitionGridPanel.ascx.cs

示例12: CustomizeBooleanColumn

 private void CustomizeBooleanColumn(GridViewRow row, string controlName, string fieldName)
 {
     var img = ((Image)row.FindControl(controlName));
     if (img != null)
     {
         bool active = Convert.ToBoolean(DataBinder.Eval(row.DataItem, fieldName));
         img.ImageUrl = active ? ImageServerConstants.ImageURLs.Checked : ImageServerConstants.ImageURLs.Unchecked;
     }
 }
开发者ID:nhannd,项目名称:Xian,代码行数:9,代码来源:FileSystemsGridView.ascx.cs

示例13: CustomizeFilesystemTierColumn

 private void CustomizeFilesystemTierColumn(GridViewRow row)
 {
     var fs = row.DataItem as Filesystem;
     var lbl = row.FindControl("FilesystemTierDescription") as Label; // The label is added in the template
     if (fs != null && lbl != null)
         lbl.Text = ServerEnumDescription.GetLocalizedDescription(fs.FilesystemTierEnum);
 }
开发者ID:nhannd,项目名称:Xian,代码行数:7,代码来源:FileSystemsGridView.ascx.cs

示例14: CustomizePathColumn

        private void CustomizePathColumn(GridViewRow row)
        {
            var fs = row.DataItem as Filesystem;
            var lbl = row.FindControl("PathLabel") as Label; // The label is added in the template

            if (fs != null && lbl!=null && fs.FilesystemPath != null)
            {
                // truncate it
                if (fs.FilesystemPath.Length > 50)
                {
                    lbl.Text = fs.FilesystemPath.Substring(0, 45) + "...";
                    lbl.ToolTip = string.Format("{0}: {1}", fs.Description, fs.FilesystemPath);
                }
                else
                {
                    lbl.Text = fs.FilesystemPath;
                }
            }
        }
开发者ID:nhannd,项目名称:Xian,代码行数:19,代码来源:FileSystemsGridView.ascx.cs

示例15: CustomizeUsageColumn

        private void CustomizeUsageColumn(GridViewRow row)
        {
            var fs = row.DataItem as Filesystem;
            var img = row.FindControl("UsageImage") as Image;

            float usage = GetFilesystemUsedPercentage(fs);
            if (fs != null && img != null)
            {
                img.ImageUrl = string.Format(ImageServerConstants.PageURLs.BarChartPage,
                                             usage,
                                             fs.HighWatermark,
                                             fs.LowWatermark);
                img.AlternateText = string.Format(Server.HtmlEncode(Tooltips.AdminFilesystem_DiskUsage).Replace(Environment.NewLine, "<br/>"),
                                  float.IsNaN(usage) ? SR.Unknown : usage.ToString(),
                                  fs.HighWatermark, fs.LowWatermark);
            }
        }
开发者ID:nhannd,项目名称:Xian,代码行数:17,代码来源:FileSystemsGridView.ascx.cs


注:本文中的System.Web.UI.WebControls.GridViewRow.FindControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。