有没有办法显示动态创建文本框并排显示? [英] Is there any ways to display the dynamically creating textboxs displays side by side?

查看:84
本文介绍了有没有办法显示动态创建文本框并排显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的aspx代码。我正在使用带有TextBox模板列的GridView。



当页面加载时,我逐行显示10个TextBox和每个TextBox。



我只想并排显示TextBox。有没有办法做到这一点?



我知道如果我们使用多个TextBox,很好就可以实现它但在这里我使用单个TextBox绑定值表格db。



我们非常感谢您的帮助。



我尝试过:



< asp:GridView ID =gvrunat =serverHeaderStyle-BackColor =GrayHeaderStyle-ForeColor =WhiteAutoGenerateColumns =falseBorderColor =GrayBorderWidth =1pxEnableTheming =TrueFont-Names =ArialFont-Size =12pxBorderStyle =SolidGridLines =NoneHeaderStyle-Height =25 HeaderStyle-Font-Size =8>

< columns>

< asp:TemplateField HeaderText =CRITERIAItemStyle-Width =500>

< itemtemplate>

< asp:TextBox ID =txtFieldNamerunat =serverEnabled =FalseAutoPostBack =true

Width =477EnableViewState =trueForeColor =#333333Font-Bold =True>







< AlternatingRowStyle BackColor =#f0f0f0ForeColor =Black/>

This is my aspx code. i am using a GridView with a TextBox template column.

When page is getting loaded, i am displaying 10 TextBox and each TextBox line by line.

I just want to display the TextBox side by side. Is there any ways to do this?

I know if we use the multiple TextBox, very well can achieve it but here i am using the single TextBox with binding the values form db.

Your help would be highly appreciated.

What I have tried:

<asp:GridView ID="gv" runat="server" HeaderStyle-BackColor="Gray" HeaderStyle-ForeColor="White" AutoGenerateColumns="false" BorderColor="Gray" BorderWidth="1px" EnableTheming="True" Font-Names="Arial" Font-Size="12px" BorderStyle="Solid" GridLines="None" HeaderStyle-Height="25" HeaderStyle-Font-Size="8">
<columns>
<asp:TemplateField HeaderText="CRITERIA" ItemStyle-Width="500">
<itemtemplate>
<asp:TextBox ID="txtFieldName" runat="server" Enabled="False" AutoPostBack="true"
Width="477" EnableViewState="true" ForeColor="#333333" Font-Bold="True">



<AlternatingRowStyle BackColor="#f0f0f0" ForeColor="Black" />

推荐答案

使用重复控制 [ ^ ]

RepeatDirection =Horizo​​ntal [ ^ ]


这篇关于有没有办法显示动态创建文本框并排显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆