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

RadGrid Rebind after UpdateCommand using a Querystring in URL

2 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Serban
Top achievements
Rank 1
Serban asked on 03 Nov 2010, 03:32 AM
I have a page:  Site.aspx?SiteID=1

The page has Load event:
If Request.QueryString("SiteID") <> "" Then
           ' Load based on SiteID
           Dim RequestedSiteID As String = Request.QueryString("SiteID")
           If IsNumeric(RequestedSiteID) Then
               Dim dbEntity As WebsiteEntities = New WebsiteEntities
 
               Dim query = (From PWPaperwork In dbEntity.PWPaperworks Where PWPaperwork.Site_ID = RequestedSiteID Select PWPaperwork)
               PaperworkGrid.DataSource = query
           End If
     Else
           Response.Redirect("Sites.aspx")
End If

This loads the Grid with just records from the SiteID querystring.

The Grid has an EditForm which used to update correctly. I added the Querystring identifier and the UpdateCommand does not rebind with the new data from the database. Only after pressing F5 will I see the changes made via the EditForm/UpdateCommand.

Is there something I should be doing with the grid PreRender? I have looked :
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/programaticlinqupdates/defaultcs.aspx

And It does not help me in my scenario.

Any ideas or suggestions to pass QueryString variables to the SQL which in turn fills the grid BUT still works with an EditForm?

Thankyou!

2 Answers, 1 is accepted

Sort by
0
Serban
Top achievements
Rank 1
answered on 08 Nov 2010, 09:52 PM
Can anyone provide any suggestions?
0
Accepted
Radoslav
Telerik team
answered on 09 Nov 2010, 08:39 AM
Hello Serban,

From your code snippet I saw that you are using the Simple DataBinding. However simple data-binding can be used in simple cases when you do not require the grid to perform complex operations such as
•   Inserting, deleting, and updating records through custom edit forms (WebUserControl or FormTemplate)
•   Grouping
•   Hierarchy relations
•   Filtering
•   Sorting
•   Paging
For advanced features such as those listed above, RadGrid must be bound using declarative data sources or through the NeedDataSource event. Could you please try using the advanced data binding with NeedDataSource event and move the logic for populating the RadGrid with data from Page_Load to NeedDataSource event and let me know if the issue  still persists.

Looking forward for your reply.

Best wishes,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Serban
Top achievements
Rank 1
Answers by
Serban
Top achievements
Rank 1
Radoslav
Telerik team
Share this question
or