|
#1
|
|||
|
|||
|
Gridview clears all columns not shown
I have a gridview that shows only some of the columns in the datasource. When I do an EDIT/UPDATE in the gridview the other columns that are not shown (example ADRES) are blank.
What am I doing wrong? The update command contains the ADRES field. (it's not only the adressfield, all other not shown columns are blank too, after an edit) <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="None" DataKeyNames="Bestelnr" SelectedIndex="0" SelectedRowStyle-BackColor="#F0F0F0"> <FooterStyle BackColor="Tan" /> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" /> <asp:BoundField DataField="Bestelnr" HeaderText="Bestelnr" ReadOnly="True" SortExpression="Bestelnr" /> <asp:BoundField DataField="Besteldatum" HeaderText="Besteldatum" ReadOnly="True" SortExpression="Besteldatum" /> <asp:BoundField DataField="tracenummer" HeaderText="tracenummer" SortExpression="tracenummer" /> <asp:BoundField DataField="Achternaam" HeaderText="Achternaam" SortExpression="Achternaam" /> <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" /> <asp:BoundField DataField="Bezorg_Naam" HeaderText="Bezorg_Naam" SortExpression="Bezorg_Naam" /> <asp:BoundField DataField="Bezorg_Woonplaats" HeaderText="Bezorg_Woonplaats" SortExpression="Bezorg_Woonplaats" /> <asp:BoundField DataField="totaal" HeaderText="totaal" SortExpression="totaal" /> </Columns> <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" /> <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" /> <HeaderStyle BackColor="Tan" Font-Bold="True" /> <AlternatingRowStyle BackColor="PaleGoldenrod" /> </asp:GridView> |
|
#2
|
|||
|
|||
|
Solved : bug in asp.net 2.0
http://www.beansoftware.com/ASP.NET-...en-Column.aspx
Protected Sub GridView1_OnRowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated If (e.Row.RowType = DataControlRowType.Header) Or (e.Row.RowType = DataControlRowType.DataRow) Then Dim intTeller For intTeller = 8 To (e.Row.Cells.Count - 1) e.Row.Cells(intTeller).Visible = False Next End If End Sub |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Columns in MSSQL filled, with Gridview empty | ensingg | ASP.NET | 0 | 09-04-2006 11:49 AM |
| Importing fixed-length text to grid - more than 255 columns | desperado1975 | .NET | 0 | 07-24-2006 12:16 PM |
| DataGrid Header in Dynamically Added Template Columns | David Hirschfeld | ASP.NET | 0 | 01-05-2003 12:49 PM |
| Access Reports - 10 columns on rpt, 11 columns on qry | Lisa | VB Classic | 0 | 11-14-2002 02:19 PM |
| Overriding Columns property of s List | Traci A Butler | .NET | 2 | 03-26-2002 11:21 AM |