This is a migrated thread and some comments may be shown as answers.

Bug: Grid not refreshing

1 Answer 95 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin Weir
Top achievements
Rank 1
Kevin Weir asked on 17 Jul 2009, 10:34 PM

I use the following code to populate a GriveView control.  As you can see oBundleEntriesDAL.GetByBundleID returns an IQueryable object which is used to set GridView.DataSource. 

 

 

 

 

Private Sub PopulateBundleEntries()

 

   Dim oBundleEntriesDAL As New BundleEntriesDAL(_ContextConnection)

 

 

     gvBundleEntries.MasterGridViewTemplate.AutoGenerateColumns =

False

 

 

 

 

    gvBundleEntries.DataSource = oBundleEntriesDAL.GetByBundleID(_BundleID)

 

 

End Sub

 

 

 

 

 

 

Public Function GetByBundleID(ByVal bundleID As Integer) As IQueryable(Of BundleEntry)

 

    Dim query = From bundleEntries In _Context.BundleEntries.Include("Bundle") _

 

 

 

                        Where bundleEntries.Bundle.BUNDLE_ID = bundleID _

 

 

 

                        Select bundleEntries

 

 

 

   Return query

 

 

 

End Function

 

 

 

 

 

 

I have a form that calls PopulateBundleEntries() when the form is loaded.   Later, if I add a row to the underlying database and call PopulateBundleEntries() again the row appears in the GridView control as it should.  However, if I change some column values for an existing row in the database and call PopulateBundleEntries() again the changes in the database are not reflected in the GridView.   I have tried clearing the rows before DataSource is set but that doesn't resolve the problem.   I tried using Rows.Clear and Rows.RemoveAt but neither of those options worked.

 

 

 

What am I doing wrong?  How do I get the GridView to display column values that have CHANGED in the underlying database?

Steps to Reproduce Problem

1) Populate GridView in Forms Load Event  (call PopulateBundleEntries())
2) Add a row to database and refresh the grid to reflect the change  (call PopulateBundleEntries())
3) Change column values for existing row in the database and refesh the grid to reflect the change   (call PopulateBundleEntries())

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 20 Jul 2009, 01:00 PM
Hello Kevin Weir,

Please find the answer to your question in your first forum post. We will also ask you not to double post your questions. We review all forum posts and support questions and having a couple of posts on the same issue slows down our response time. Forum response time is 72 hours although we may response faster if we can. Thank you for the understanding.

Greetings,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Kevin Weir
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or