Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
XML
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div style="height: 365px">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        <br />
        <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
            Height="170px" Width="410px">
            <asp:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
            <ContentTemplate>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                    DataSourceID="SqlDataSource1">
                    <Columns>
                        <asp:BoundField DataField="colname" HeaderText="colname"
                            SortExpression="colname" />
                        <asp:BoundField DataField="colno" HeaderText="colno" SortExpression="colno" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                    ConnectionString="<%$ ConnectionStrings:specConnectionString %>"
                    SelectCommand="SELECT * FROM [spectbl]"></asp:SqlDataSource>
            </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
            </asp:TabPanel>
        </asp:TabContainer>

    </div>
    </form>
</body>
</html>




Here I have one problem.

I want to be placed gridview control inside the first tab content.
But it didnt display when the page is displaying in browser.
No errors occur. What is my mistake. Pls anyone help me.
And tell how to display database via gridview control inside AJAX tab container.

Thanks
Posted
Updated 1-Jul-11 3:27am
v5
Comments
R. Giskard Reventlov 1-Jul-11 9:20am    
What have you tried for yourself?
CS1401 1-Jul-11 9:24am    
try to display a data from my table to gridview inside the tab control. thats all.
R. Giskard Reventlov 1-Jul-11 9:38am    
What did you actually do? How far did you get? What errors/exceptions did you get? Did you try handling them? Did you try taking the grid outside the panel? Did it display correctly if you did that?
DaveAuld 1-Jul-11 9:27am    
edit: ammend code block formatting

1 solution

Did you bind the GridView to your datasource and also make sure you have the field name in the data.

TanvTech
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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