Telerik 网格中的 asp 标签可见 false 和 true 取决于组合框所选项目

发布于 2024-08-18 13:05:55 字数 1983 浏览 3 评论 0原文

取决于所选的 telerik 组合框项目,当我在 aspx 页面中编写这样的代码时,我想显示标签名称和文本框

<telerik:GridTemplateColumn DataField="DeductionCode"   Visible="false" UniqueName="DeductionCode"  HeaderText="DeductionCode">
                                    <ItemTemplate>
                                        <asp:Label runat="server" Visible="false" ID="lblDeductionCode"   Text='<%# Eval("DeductionCode") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <telerik:RadTextBox ID="txtDeductionCode" Visible = "false" runat="server" Text='<%# Bind("DeductionCode") %>' MaxLength="2"></telerik:RadTextBox>
                                        <asp:RequiredFieldValidator  ControlToValidate="txtDeductionCode" ID="rfvtxtDeductionCode" Display="Dynamic" runat="server" ></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator id="revtxtDeductionCode" 
                                               ControlToValidate="txtDeductionCode"
                                               ValidationExpression="^[a-zA-Z0-9'`-´\s]{2}$"
                                               Display="Dynamic"
                                               ErrorMessage="Please Enter 2 charecters only"                                                 
                                              runat="server"
                                              SetFocusOnError="True" />

                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>                          

当我尝试在 page_load lbldeduction= false 上编写时,标签名称显示错误消息..另一种方式我试图在编译时在 selectedindexed 函数中显示可见 false 和 true,显示错误,如 lbldeductioncode 具有空值,但 texbox 工作正常,如可见 false 和 true ..唯一的问题是我无法执行标签名称可见 false 和之后选定的组合框项目标签名称可见 true..

depends on the selected telerik combox item i would like to display the label name and text box when im writing the code like this in aspx page

<telerik:GridTemplateColumn DataField="DeductionCode"   Visible="false" UniqueName="DeductionCode"  HeaderText="DeductionCode">
                                    <ItemTemplate>
                                        <asp:Label runat="server" Visible="false" ID="lblDeductionCode"   Text='<%# Eval("DeductionCode") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <telerik:RadTextBox ID="txtDeductionCode" Visible = "false" runat="server" Text='<%# Bind("DeductionCode") %>' MaxLength="2"></telerik:RadTextBox>
                                        <asp:RequiredFieldValidator  ControlToValidate="txtDeductionCode" ID="rfvtxtDeductionCode" Display="Dynamic" runat="server" ></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator id="revtxtDeductionCode" 
                                               ControlToValidate="txtDeductionCode"
                                               ValidationExpression="^[a-zA-Z0-9'`-´\s]{2}$"
                                               Display="Dynamic"
                                               ErrorMessage="Please Enter 2 charecters only"                                                 
                                              runat="server"
                                              SetFocusOnError="True" />

                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>                          

when im trying to write the on page_load lbldeduction= false the label name is displaying error message..another way i trying to visible false and true in selectedindexed function on compiling time displaying the error like lbldeductioncode is having null value but texbox is working fine like visible false and true..only the problem is i cant able to do the label name visible false and after selected combox item label name visible true..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不必了 2024-08-25 13:05:55

我在 Telerik 网站上找到了一个演示,可以让您在实施方面取得领先 - 看看它 此处

迪克

I found a demo on the Telerik site that can give you a head start with your implementation - take a look at it here.

Dick

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文