Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I have grid in which I am displaying timeslots and with respect to patient appointments in the first column i have time slots and in the second and third column i have patient name and date of birth and above those columns i need facility_name and provider_name id as header names for all the rows of the appointment.

here is my screen shots
here is my aspx code

XML
<asp:GridView ID="gvreceptionist" runat="server"
                AutoGenerateColumns="False"
                onselectedindexchanged="gvdisplayappointments_SelectedIndexChanged">
                <Columns>

                   <asp:TemplateField HeaderText="Appointment Time">
                         <ItemTemplate>
                            <asp:LinkButton ID="lbtodaytimeslotrep" runat="server"
                                onclick="lbtodaytimeslotrep_Click"
                                Text='<%# Eval("first_appointment_time", "{0:hh:mm tt}") %>'>
                            </asp:LinkButton>
                            <asp:HiddenField ID="hftimeslotidrep" runat="server"
                                Value='<%# Eval("tmslot_id") %>' />
                                </ItemTemplate>
                   </asp:TemplateField>
                   <asp:TemplateField HeaderText="Name">

                        <ItemTemplate>
                            <asp:Label ID="lblaptfacilityname" runat="server"
                                Text='<%# Eval("facility_name") %>'>
                            </asp:Label>
                            <asp:Label ID="lblaptprovidername" runat="server"
                                Text='<%# Eval("provider_name") %>'>
                            </asp:Label>
                            <asp:LinkButton ID="lbpatient" runat="server" Text='<%# Eval("fname") %>'
                                onclick="lbpatient_Click">
                            </asp:LinkButton>
                        </Itemtemplate>
                   </asp:TemplateField>
                   <asp:TemplateField HeaderText="DOB">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbdob" runat="server" onclick="lbdob_Click"
                                Text='<%# Eval("DOB") %>'></asp:LinkButton>


                            <asp:HiddenField ID="hfpid" runat="server" Value='<%# Eval("pc_pid") %>' />

                        </ItemTemplate>
                   </asp:TemplateField>
                        </Columns>

            </asp:GridView>


and I am binding the data from table for that facility_name and provider_name.

Does any body has solution for this?

Thank you
Posted

1 solution

You can change heading by doing following changes

<asp:gridview id="gvreceptionist" runat="server" xmlns:asp="#unknown">
                AutoGenerateColumns="False"
                onselectedindexchanged="gvdisplayappointments_SelectedIndexChanged">
                <columns>
 
                   <asp:templatefield headertext="Your Header name here">
                         <itemtemplate>
          </itemtemplate></asp:templatefield></columns></asp:gridview>
 
Share this answer
 
Comments
Member 9413472 20-Sep-12 9:48am    
i need those lable value from database table i dont need just header text how can i do that?
Usman599 20-Sep-12 9:50am    
Just change the value of field from design view of database.

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