Click here to Skip to main content
15,896,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:GridView ID="grdcareplan" runat="server" CellPadding="5" CssClass="CustomGrid" ShowFooter="True"
 AutoGenerateColumns="False" GridLines="Horizontal" AllowPaging="True"  DataKeyNames="ParameterId"
        Width="950px" onselectedindexchanged="grdcareplan_SelectedIndexChanged1" 
        onpageindexchanging="grdcareplan_PageIndexChanging" Height="16px" 
        style="margin-right: 0px" onrowediting="grdcareplan_RowEditing" onrowcancelingedit="grdcareplan_RowCancelingEdit" 
        onrowupdating="grdcareplan_RowUpdating" 
        onrowdeleting="grdcareplan_RowDeleting" 
        EmptyDataText="No Record found for this Item">
                            <columns>
                            <asp:CommandField EditText="<img src='images/HMS Buttons/edit_icon.png'>" ShowEditButton="true" UpdateText="<img src='images/HMS Buttons/edit_icon.png'>" />
                             <asp:TemplateField>
                             <itemstyle cssclass="w" />
                               <itemtemplate>
                                        <asp:ImageButton ID="Imgbtnsave" runat="server" 
                                            ImageUrl="~/images/HMS Buttons/LaunchIcon.png" CssClass="icon" 
                                            onclick="Imgbtnsave_Click"/>
                                        </itemtemplate>
                             
                               
                              <asp:BoundField DataField="ParameterName" HeaderText="Scheduled Items" 
                                    ReadOnly="True" />
                              <asp:TemplateField HeaderText="Target Value">
                                   
                                    <itemtemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("Target_Value") %>'>
                                    </itemtemplate>
                                     <edititemtemplate>
                                        <asp:TextBox ID="txttargetvalue" runat="server" 
                                            Text='<%# Bind("Target_Value") %>' CssClass="textboxInGrid">
                                    </edititemtemplate>
                                
                                <%--<asp:BoundField DataField="UOM" HeaderText="UOM" ReadOnly="True" />--%>
                                <asp:TemplateField HeaderText="Last dt">
                                <itemtemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Last_Date") %>'>
                                
                                </itemtemplate>
                                <edititemtemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("Last_Date") %>'>
                                </edititemtemplate>
                                
                                <asp:TemplateField HeaderText="Result">
                                <itemtemplate>
                                    <asp:Label ID="Label3"  runat="server" Text='<%# Bind("Result") %>'>
                                </itemtemplate>
                                <edititemtemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("Result") %>'>
                                </edititemtemplate>
                                
                                

                                  <asp:TemplateField HeaderText="Test dt">
                                <itemtemplate>
                                    <asp:Label ID="Label9" runat="server" Text='<%# Bind("Current_Test_Date") %>'>
                                    </itemtemplate>
                                <edititemtemplate>
                                    <asp:TextBox ID="txttestdate" runat="server" Text='<%# Bind("Current_Test_Date") %>' CssClass="textboxInGrid">
                                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txttestdate" Format="yy/dd/MM">
                                    
                                   </edititemtemplate>
                                
                               <%-- <asp:BoundField HeaderText="Test Result" />--%>
                               <asp:TemplateField HeaderText="Test Result">
                               <itemtemplate>
                                   <asp:Label ID="Label8" runat="server" Text='<%# Bind("Test_Result") %>'>
                               </itemtemplate>
                               <edititemtemplate>
                                   <asp:TextBox ID="txttestresult" runat="server" Text='<%# Bind("Test_Result") %>' CssClass="textboxInGrid">
                               </edititemtemplate>
                               

                                <asp:TemplateField HeaderText="Measurement Frequency">
                                    
                                    <itemtemplate>
                                        <asp:Label ID="Label2" runat="server" 
                                            Text='<%# Bind("Measurement_Frequency") %>'>
                                    </itemtemplate>
                                    <edititemtemplate>
                                        <asp:DropDownList ID="ddlMeasurementFrequency" runat="server"  AutoPostBack="true"
                                            onselectedindexchanged="ddlMeasurementFrequency_SelectedIndexChanged">
                                            <asp:ListItem>Select Frequency
                                            <asp:ListItem Value="1">Daily
                                            <asp:ListItem Value="2">Weekly
                                            <asp:ListItem Value="3">Fortnightly
                                            <asp:ListItem Value="4">Monthly
                                            <asp:ListItem Value="5">Quarterly
                                            <asp:ListItem Value="6"> Half Yearly
                                            <asp:ListItem Value="7">Yearly
                                            <asp:ListItem Value="8">Others
                                        
                                    </edititemtemplate>
                                
                                <asp:TemplateField HeaderText="Next Due dt">
                                <itemtemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("Next_Due_Date") %>'>
                                </itemtemplate>
                                <edititemtemplate>
                                    <asp:TextBox ID="txtnextduedate" runat="server" Text='<%# Bind("Next_Due_Date") %>' CssClass="textboxInGrid">
                                    <asp:CalendarExtender ID="CalendarExtender2" runat="server"  TargetControlID="txtnextduedate" Format="yy/dd/MM">
                                    
                                </edititemtemplate>
                                
                          
                            </columns>
                            <footerstyle cssclass="GridFooter" />
                            <HeaderStyle CssClass="grdheaderstyle"></HeaderStyle>
                            <rowstyle cssclass="grdrowstyle" />

This is my procedure..which i tried..but it is not working
SQL
DROP PROCEDURE IF EXISTS hms.Select_LastDate_Result;

CREATE PROCEDURE hms.`Select_LastDate_Result`()
   BEGIN
      SELECT top(1)Last_Date, Result
        FROM patient_progress_tracking_details
       WHERE (SELECT top(1) Current_Test_Date, Test_Result
                FROM patient_progress_tracking_details
              ORDER BY Current_Test_Date, Test_Result DESC);
   END;

This is my grid ...on save Image button click,I want to take value from Current_Test_Date and Test_Result and that should be displayed in Last_Date and Result,What Will be the procedure for that...
Posted
Updated 4-Jan-13 20:36pm
v2
Comments
Jibesh 6-Jan-13 3:54am    
"it is not working" can be for any reason. can you please provide some sample data with records.

1 solution

Try this

SQL
SELECT top 1 Current_Test_Date as Last_Date, Test_Result as Result
FROM patient_progress_tracking_details (NOLOCK)
ORDER BY Current_Test_Date, Test_Result DESC



Accept Answer if it helps you :)
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900