如何将值从gridview传递到弹出窗口(更新) [英] how to pass values from gridview to popup window (update)

查看:52
本文介绍了如何将值从gridview传递到弹出窗口(更新)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

请帮我..

最近2周,我已经成功使用弹出窗口从gridview更新了值..但是我注意到当我在aspx页面上进行编辑以使gridview固定布局时,将值传递给弹出窗口的过程没有用. >
该值未显示在其中..如果我使用asp:boundfield,则显示来自gview的值,但是如果我使用asp:templatefield,则不会在弹出窗口中显示任何值........但是asp:templatefield很重要,因为如果用户输入长字符串,我想打断单词

目前只有日期显示在弹出窗口中,否则为空白..我需要今天完成此操作.请帮助我..

在此先感谢
musiw.

-后面的代码-

hi guys,

please help me on this..

last 2 weeks i already success to update value from gridview using popup window..but i notice when i edit on aspx page which is to make the gridview fix layout, the process to pass the value to popup window didnt work it.

the value isnt displayed there..if i use asp:boundfield the value from gview is displayed, but if i use asp:templatefield no value displayed on popup window..........but asp:templatefield is important as if user enter long string i want to break word

currently only date is displayed on popup window, else blank..i need to finish this today.please help me..

thanks in advance
musiw.

--code behind--

Protected Sub Close_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim row As GridViewRow = CType(CType(sender, LinkButton).Parent.Parent, GridViewRow)
        
        Label1.Text = row.Cells(1).Text
        lbltask.Text = row.Cells(2).Text
        lblpic.Text = row.Cells(3).Text
        lblstart.Text = row.Cells(4).Text 
        lbldue.Text = row.Cells(5).Text
        TextBox1.Text = row.Cells(6).Text
        

        Me.OfficePopup1.Show()
    End Sub



--aspx页面-



--aspx page--

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 

                    AutoGenerateColumns="False"  

                    Font-Names="Arial" HeaderStyle-ForeColor="Black" 

                    

                    ShowFooter="True" Font-Size="9" Width="100%" DataKeyNames="id" OnRowDataBound="GridView1_RowDataBound" OnPageIndexChanging="GridView1_PageIndexChanging">
                    <columns>
                        <asp:TemplateField HeaderText="">
                        <itemtemplate>
                            <asp:LinkButton ID="LinkButton1" ItemStyle-Width="70px" ItemStyle-Height="50px" runat="server" Text="Close?" OnClick="Close_Click">
                                                
                        </itemtemplate>
                        
                        <asp:BoundField HeaderText="Task ID" ReadOnly="true" DataField="id" ItemStyle-Width="70px" ItemStyle-Height="50px"/>
                           <asp:TemplateField HeaderText="Task" ItemStyle-Width="300px" ItemStyle-Height="50px">
       <itemtemplate>
       <div style="word-wrap: break-word; width: 300px; height: 50px; overflow:auto;">
            <%# Eval("title_task")%></div>
       </itemtemplate>
       
                           <asp:TemplateField HeaderText="PIC" ItemStyle-Width="250px" ItemStyle-Height="50px">
       <itemtemplate>
       <div style="word-wrap: break-word; width: 250px; height: 50px; overflow:auto;">
            <%# Eval("pic")%></div>
       </itemtemplate>
       
                            <asp:BoundField HeaderText="Start Date" ReadOnly="true" DataField="mula" ItemStyle-Width="70px" ItemStyle-Height="50px"/>
                            <asp:BoundField HeaderText="Due Date" ReadOnly="true" DataField="tamat" ItemStyle-Width="70px" ItemStyle-Height="50px"/>
                            <asp:TemplateField HeaderText="Status/Remarks" ItemStyle-Width="350px" ItemStyle-Height="50px">
       <itemtemplate>
       <div style="word-wrap: break-word; width: 350px; height: 50px; overflow:auto;">
            <%# Eval("status_remarks")%></div>
       </itemtemplate>
       
                            <asp:BoundField HeaderText="Indicator" ReadOnly="true" DataField="indicator" ItemStyle-Width="100px" ItemStyle-Height="50px"/>
                    </columns>
                    <emptydatatemplate>
        No Record Found
        </emptydatatemplate>
                
                
    <asp:Label ID="Label1" runat="server" Text="" Visible="false">
    <asp:Label ID="Label7" runat="server" Text="" Visible="false">
    <asp:Label ID="Label9" runat="server" Text="" Visible="false">
    <asp:Label ID="Label8" runat="server" Text="" >
    <asp:Button ID="showPop" runat="server" Text="Button" />
    <OfficeWebUI:OfficePopup ID="OfficePopup1"  runat="server"  önClickOk="Update" Title="Closing A Task" Height="300">
    <content>
    <table style="width: 100%;">
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Task:" >
                </td>
                <td>
                    <asp:Label ID="lbltask" runat="server"  >
                </td>
                </tr>
                <tr>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="PIC:" >
                </td>
                <td>
                    <asp:Label ID="lblpic" runat="server" >
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label4" runat="server" Text="Start Date:" Font-Bold="True" Font-Size="9">
                </td>
                <td>
                    <asp:Label ID="lblstart" runat="server" Font-Size="9">
                </td>
                </tr>
                <tr>
                <td>
                    <asp:Label ID="Label5" runat="server" Text="Due Date:" Font-Bold="True" Font-Size="9">
                </td>
                <td>
                    <asp:Label ID="lbldue" runat="server" Font-Size="9">
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label6" runat="server" Text="Reason to Close:" Font-Bold="True" Font-Size="9">
                </td>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Width="250px" Font-Size="9">
                    
                </td>
                </tr>
                <tr>
                <td>
                    
                    <asp:CheckBox ID="CheckBox1" runat="server" Text="COMPLETE" Font-Size="9"/>
                </td>
                
            </tr>
        </table>
    </content>

推荐答案

尝试一下

http://forums.asp.net/t/1383424.aspx/1 [ ^ ]
try this

http://forums.asp.net/t/1383424.aspx/1[^]


这篇关于如何将值从gridview传递到弹出窗口(更新)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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