<asp:Panel ID="Pan_main2" runat="server" Width="100%"> <asp:GridView runat="server" ID="grd"></asp:GridView> <asp:GridView runat="server" ID="gv" AutoGenerateColumns="false" PageSize="5" GridLines="None" Width="80%" align="center" > <HeaderStyle BackColor="#84A8C9" /> <AlternatingRowStyle BackColor="#F4FAFF" /> <RowStyle BackColor="#DBECFB" /> <Columns> <asp:TemplateField> <HeaderTemplate> <font color="#F4FAFF"><b>Action</b></font> </HeaderTemplate> <ItemTemplate> <asp:CheckBox runat="server" ID="chkid" Width="16" /> <asp:Button runat="server" Text="Edit" CommandName="edit" /> <asp:Button runat="server" Text="del" CommandName="del" /> </ItemTemplate> <ItemStyle Height="12%" Width="13%" /> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> <font color="#F4FAFF"><b>Name</b></font> </HeaderTemplate> <ItemTemplate> <font color="#034f94"> <%--<asp:Label ID="lblName" runat="server" Text='<%#Eval("Course_name") %>' />--%> <asp:Literal ID="ltrl" runat="server" Text='<%#Eval("Course_name") %>'></asp:Literal> </font> </ItemTemplate> <ItemStyle Height="12%" HorizontalAlign="Left" Width="28%" /> <HeaderStyle HorizontalAlign="Left" /> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> <font color="#F4FAFF"><b>Duration</b></font> </HeaderTemplate> <ItemTemplate> <font color="#034f94"> <asp:Literal ID="lt_fees" runat="server" Text='<%#Eval("Course_duration") %>'></asp:Literal> </font> </ItemTemplate> <ItemStyle Height="12%" HorizontalAlign="Left" Width="28%" /> <HeaderStyle HorizontalAlign="Left" /> </asp:TemplateField> </Columns> </asp:GridView> </asp:Panel>
cmd.Connection.Open(); gv.DataSource = cmd.ExecuteReader(); gv.DataBind();
Protected void ContactsGridView_RowCommand(Object sender, GridViewCommandEventArgs e) { if(e.CommandName=="Add") { //code to open new panel } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)