Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET .NET VB.NET
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>
Posted 17-Sep-12 16:27pm
musiw642
Edited 17-Sep-12 19:48pm
v3
Comments
Menon Santosh at 18-Sep-12 0:51am
   
you can use sessions to pass the value to popups
veenusethi at 18-Sep-12 1:52am
   
ya you should use sessions and using sessions you should pass unique id and then all values are also will pass in popup window

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,656
1 Sergey Alexandrovich Kryukov 6,400
2 CPallini 5,240
3 George Jonsson 3,584
4 Gihan Liyanage 2,625


Advertise | Privacy | Mobile
Web03 | 2.8.140921.1 | Last Updated 24 Sep 2012
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