当前位置: 首页 > news >正文

怎样查网站的注册地点百度关键词热度查询工具

怎样查网站的注册地点,百度关键词热度查询工具,集团做网站,服务器租用多少钱一月最近一直在忙于工作项目的事,因此也许久未更新。这次更新一篇,在项目中遇见的一个奇特需求的解决方法。 在项目中,遇见一个需求,老板需要在表格中,加入单选框。 需求模板:需求如图中的工艺做法判定和质量判…

        最近一直在忙于工作项目的事,因此也许久未更新。这次更新一篇,在项目中遇见的一个奇特需求的解决方法。

        在项目中,遇见一个需求,老板需要在表格中,加入单选框。

需求模板:需求如图中的工艺做法判定和质量判定。

        在这个项目中,表格,我们使用的是asp:GridView。单选框我准备使用asp:RadioButtonList。

        需要在GridView中自定义列,则需要使用自定义模板asp:TemplateField。

具体前台代码

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"ForeColor="#333333" GridLines="None"OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing"OnRowUpdating="GridView1_RowUpdating"OnRowCancelingEdit="GridView1_RowCancelingEdit" CssClass="DataGridBorder"Width="900" Font-Size="16px" OnRowDataBound="GridView1_RowDataBound"><FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /><Columns><asp:BoundField DataField="Serial" HeaderText="序号" ReadOnly="true" HeaderStyle-Width="60" /><asp:BoundField DataField="Position" HeaderText="部位名称" ReadOnly="true" HeaderStyle-Width="100" /><asp:TemplateField HeaderText="工艺做法判定"><ItemTemplate><asp:RadioButtonListID="CraftWay" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"><asp:ListItem Value="正确">正确</asp:ListItem><asp:ListItem Value="错误">错误</asp:ListItem></asp:RadioButtonList></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="质量判定"><ItemTemplate><asp:RadioButtonListID="Quality" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"><asp:ListItem Value="合格">合格</asp:ListItem><asp:ListItem Value="不合格">不合格</asp:ListItem></asp:RadioButtonList></ItemTemplate></asp:TemplateField><asp:BoundField DataField="DetailNote" HeaderText="备注说明" HeaderStyle-Width="150" /><asp:CommandField HeaderText="选择" ShowSelectButton="True" /><asp:CommandField HeaderText="编辑" ShowEditButton="True" /><asp:CommandField HeaderText="删除" ShowDeleteButton="True" /></Columns><RowStyle CssClass="DataGridHeadr" /><SelectedRowStyle CssClass="GridViewSelectedRowStyle" /><PagerStyle CssClass="DataGridPager" /><HeaderStyle CssClass="GridViewHeaderStyle" />
</asp:GridView>

后台获取表格单选框信息代码

for (int i = 0; i < GridView1.Rows.Count; i++)
{DataRow newRow = dtInfo.NewRow();//部位string position = GridView1.DataKeys[i]["Position"].ToString();// position == "&nbsp;":防止为空时,获取的是:&nbsp:if (position == "&nbsp;") position = "";newRow["Position"] = position;//标识string serial = GridView1.Rows[i].Cells[0].Text;if (serial == "&nbsp;") serial = "";newRow["Serial"] = serial;// 工艺做法判定string craftWay = ((RadioButtonList)(GridView1.Rows[i].FindControl("CraftWay"))).Text;newRow["CraftWay"] = craftWay;// 质量判定string quality = ((RadioButtonList)(GridView1.Rows[i].FindControl("Quality"))).Text;newRow["Quality"] = quality;//备注说明string detailNote = GridView1.Rows[i].Cells[4].Text;if (detailNote == "&nbsp;") detailNote = "";newRow["DetailNote"] = detailNote;dtInfo.Rows.Add(newRow);
}

使用 RadioButtonList)(GridView1.Rows[i].FindControl("单选框ID") 可以获取到该行的单选框,再用 .Text 可以获取到选择的选项数据。用循环读取,可以获取到整个 GridView 表格信息。

后台绑定数据到前台代码

// 副表单选框处理
protected void TableRadlSelect()
{for (int i = 0; i < dtInfo.Rows.Count; i++){// 根据数据绑定,如果为空则清空单选框的选择,不为空则绑定选项if (dtInfo.Rows[i]["CraftWay"].ToString() == "" || dtInfo.Rows[i]["CraftWay"] == null){// 清空选项选择((RadioButtonList)(GridView1.Rows[i].FindControl("CraftWay"))).Items[0].Selected = false;((RadioButtonList)(GridView1.Rows[i].FindControl("CraftWay"))).Items[1].Selected = false;}else{// 绑定选项((RadioButtonList)(GridView1.Rows[i].FindControl("CraftWay"))).Text = dtInfo.Rows[i]["CraftWay"].ToString();}if (dtInfo.Rows[i]["Quality"].ToString() == "" || dtInfo.Rows[i]["Quality"] == null){((RadioButtonList)(GridView1.Rows[i].FindControl("Quality"))).Items[0].Selected = false;((RadioButtonList)(GridView1.Rows[i].FindControl("Quality"))).Items[1].Selected = false;}else{((RadioButtonList)(GridView1.Rows[i].FindControl("Quality"))).Text = dtInfo.Rows[i]["Quality"].ToString();}}
}

        对于后台绑定数据到前台展示,我创建了一个方法,每次需要使用的时候,调用这个方法进行绑定。

http://www.wangmingla.cn/news/39998.html

相关文章:

  • 做网站价格多少上海网站优化
  • 网站的二维码怎么做google关键词排名查询
  • 中国最好的旅游网站通州区网站快速排名方案
  • iis怎么添加网站搜索引擎优化与关键词的关系
  • 荔湾做网站公济宁百度推广公司有几家
  • 头像设计制作网站it学校培训学校哪个好
  • 店铺网站平台建设方案高端网站设计
  • 网站建设需要矢量文件百度推广信息流有用吗
  • 代人做网站长沙seo网络营销推广
  • 网络营销推广渠道有哪些单词优化和整站优化
  • 去招聘网站做顾问百度站内搜索
  • 做网站社区赚钱吗新塘网站seo优化
  • 毕设做网站是不是太low谷歌浏览器下载手机版官网中文
  • 建设工程教育网视频网站河南省疫情最新情况
  • php网站开发文档怎么写扬州seo博客
  • 网站SEO基础代做交换友情链接的要求有
  • 网站建设及推广套餐seo引擎优化外包
  • 做网站要用什么软件网站设计制作
  • 下载软件app排行榜朝阳seo
  • 工程分包网关键词优化策略
  • 网站建设管理人员推荐表最新国际新闻
  • 腾讯做的购物网站aso排名优化
  • 公文写作 课程中心网站建设seo手机关键词网址
  • 自己网站上放个域名查询seo文章推广
  • 大连网站建设个人百度手机端推广
  • 图像处理专业网站西安优化网站公司
  • 机关网站建设方案提交网站收录入口
  • 网站优化建设绵阳什么是seo站内优化
  • 天津网站排名优化费用网站关键词优化系统
  • 网络搭建赛项承办市赛申报书关键词优化推广公司哪家好