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

高端公司形象墙效果图购物网站seo搜索引擎前期分析

高端公司形象墙效果图,购物网站seo搜索引擎前期分析,宿迁建设公司网站,中文 wordpress插件下载最近一直在忙于工作项目的事,因此也许久未更新。这次更新一篇,在项目中遇见的一个奇特需求的解决方法。 在项目中,遇见一个需求,老板需要在表格中,加入单选框。 需求模板:需求如图中的工艺做法判定和质量判…

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

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

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

        在这个项目中,表格,我们使用的是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.yayakq.cn/news/464090/

相关文章:

  • 做网站需要用socket吗成寿寺网站建设公司
  • 中山网站制作设计章丘做网站的公司
  • 企业网站制作优化wordpress从指定目录获取文章
  • 潍坊做网站好看电子商务网站建设风格
  • 从化市网站建设wordpress shortinit
  • 一家专做灯的网站招聘室内设计可以去哪些公司
  • 贵州茅台酒股份有限公司网站做计算机网站的总结
  • 在北京网站建设的岗位职责北京网站建设可选兴田德润
  • 北京建设网站兼职普工网站seo优化查询
  • 找单位做网站需要注意什么wordpress 件康
  • 衡阳网站制作公司wordpress所有标签
  • 要建设一个网站需要准备些什么赵公口网站建设北京网站设计
  • 教你免费申请个人网站株洲网站建设企业
  • 网站图标只做那个网站有免费的模板
  • 卖机械设备什么网站做推广好上海网站建设规划
  • 做网站都需要哪些费用买域名哪个网站好
  • 龙华区住房和建设局网站代理注册公司怎么收费
  • 北京网站制作网络推广公司潍坊点睛做网站怎么样
  • 做弹幕网站阿里云网站商城建设
  • 青岛黄岛网站建设公司电话东莞市南城装饰工程东莞网站建设
  • 软件开发网站建设科技有限公司郴州市北湖建设局网站
  • 拓者设计吧网站南京网络推广外包
  • 高品质外贸网站建设python编程软件安装教程
  • 小型行业网站建设维护成本传媒网页设计
  • 电子商务网站运营与...台州市建设规划局路桥分局网站
  • 交互网站怎么做的wordpress的模板文件
  • 钓鱼网站在线下载wordpress the7使用教程
  • 网站建设相关岗位名称怎么做网站分站
  • 网站建设要什么知识线上产品推广方案
  • 自己做的网站注册用户无法收到激活邮箱的邮件扬州市广陵区建设局网站