Click here to Skip to main content

musiw asked:

Open original thread
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 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>
Tags: VB.NET, .NET, ASP.NET

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).



Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100