Home All Groups Group Topic Archive Search About

Gridview only displays 3 columns of 11 column dataset

Author
12 Jan 2007 4:44 PM
JJA
I've got a very "default" GridView control that is only showing 3 cols
of my dataset which has 11 cols. I do have AutoGenerateColumns property
set to true. Here is my code:
<div>
        <asp:GridView ID="GridView1" runat="server">
        </asp:GridView>
</div>

Here is my code file:

responseWS = proxy.MarketShare(parm1)              'response from XML
Native Web Services (SQL 2005)
' loop through responseWS object array to find the individual items
For i = 0 To Microsoft.VisualBasic.UBound(responseWS)
         Select Case responseWS(i).GetType().ToString()
                   Case "System.Data.DataSet"
                            Dim ds As System.Data.DataSet
                            ds = DirectCast(responseWS(i),
System.Data.DataSet)
                            GridView1.DataSource = ds.Tables(0)
   'immediate window shows that ds.Tables(0).Columns.Count is 11
                            GridView1.DataBind()

The grid shows OK except for the fact that only 3 columns are
displayed. I know this Gridview can get quite elegant and fancy but at
this point, I just want it to display all the data plainly. Could
someone suggest something please? I am running ASP.NET 2.0 Visual
Studio 2005 on Windows XP.

Author
23 Jan 2007 3:12 PM
bhavesh
hi jja,

just set AutoGenerateColumns propertyto false to get the effect of ur
11 columns
JJA wrote:
Show quoteHide quote
> I've got a very "default" GridView control that is only showing 3 cols
> of my dataset which has 11 cols. I do have AutoGenerateColumns property
> set to true. Here is my code:
> <div>
>         <asp:GridView ID="GridView1" runat="server">
>         </asp:GridView>
> </div>
>
> Here is my code file:
>
> responseWS = proxy.MarketShare(parm1)              'response from XML
> Native Web Services (SQL 2005)
> ' loop through responseWS object array to find the individual items
> For i = 0 To Microsoft.VisualBasic.UBound(responseWS)
>          Select Case responseWS(i).GetType().ToString()
>                    Case "System.Data.DataSet"
>                             Dim ds As System.Data.DataSet
>                             ds = DirectCast(responseWS(i),
> System.Data.DataSet)
>                             GridView1.DataSource = ds.Tables(0)
>    'immediate window shows that ds.Tables(0).Columns.Count is 11
>                             GridView1.DataBind()
>
> The grid shows OK except for the fact that only 3 columns are
> displayed. I know this Gridview can get quite elegant and fancy but at
> this point, I just want it to display all the data plainly. Could
> someone suggest something please? I am running ASP.NET 2.0 Visual
> Studio 2005 on Windows XP.