添加标签&下载到datalist [英] Adding of Labels & Dropdowns to the datalist

查看:76
本文介绍了添加标签&下载到datalist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在项目模板中添加标签作为标题模板和静态下拉列表。

- >标签将动态创建。

- >并且每个标签在下一行应该有DDL。

- >第一行中的所有标签和下一行中的所有DDL。



我尝试使用中继器,它没有按预期工作。所以,我使用了Datalist。但是,我无法以所需的格式显示数据(2行=> 1表示标签,1表示下拉)

I want to add the labels as header template & the static Dropdownlist in the Item template.
-> The labels will be created dynamically.
-> And Each Label should have DDL in the next row.
-> All Labels in 1st row & all DDLs in next row.

I tried with repeater, it was not working as expected. So, I used Datalist. However, I am not able to display the data in the required format (2 rows=> 1 for label & 1 for Dropdown)

推荐答案

最后我想出了解决方案。这就是我想要的。



Finally I came up with the solution. This is what I wanted.

<table border="0" width="100%">
        <tr>
        <asp:datalist id="dlstStatus" runat="server" repeatcolumns="0" cellspacing="0"  RepeatDirection="Horizontal" RepeatLayout="Table" Font-Bold="true" BorderWidth="1px" BorderColor="Black" BorderStyle="Double"

                ForeColor="White" BackColor="Gray">
                <itemtemplate> 
                    <td align="center">
                        <asp:label id="lblPA" runat="server" text="<%# Eval("PA_Type") %>"></asp:label></td>
                    <td><asp:dropdownlist runat="server" id="ddlStatus">
                                    <asp:listitem selected="True" text="--Select--" value="Select" />
                                    <asp:listitem text="X" value="X" />
                                    <asp:listitem text="Y" value="Y" />
                                    <asp:listitem text="Z" value="Z" />
                                    </asp:dropdownlist>
                        </td>
                 </itemtemplate>
            </asp:datalist></tr>
   </table>


这篇关于添加标签&amp;下载到datalist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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