Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > ASP.NET

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-05-2006, 10:00 AM
ensingg ensingg is offline
Registered User
 
Join Date: Aug 2006
Posts: 17
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>
Attached Files
File Type: txt test.txt (12.3 KB, 43 views)
Reply With Quote
  #2  
Old 09-06-2006, 12:45 PM
ensingg ensingg is offline
Registered User
 
Join Date: Aug 2006
Posts: 17
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
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT -4. The time now is 12:44 AM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.