Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Update/Refresh GridView?Update/Refresh GridView?
Previous
 
Next
New Post
8/2/2007 11:09 AM
 



Am using two seperate GridViews within one module.
GridView1 has FormView that is linked to GridView1 and inputs form data to databaseA.
Uses ajax for editing/deleting.

GridView2 is a view only GridView that is linked to same databaseA.
GridView2 is designed to search by certain data under event named: ShowData

When page_loads, GridView2 is using ShowData("")  open serach string.
This updates/refreshes the page when loaded and shows all of databaseA contents.

If I start from scratch and drop the module, all is fine. I can add data through GridView1, and it is displayed in Gridview2 as well.
Yet if I delete the module, and re-drop (which just now I realized it is not saving unique to module ID, but in this case is ok)
GridView2 has all data, and GridView 1 starts blank.  I can add data, but it doesn't start by pulling all data.
Analyzed ShowData, and tried to create one for GridView1, but has conflictions.
Also tried Me.GridView1.DataBind(), but seems to crash module.

What is simple way to update/refresh a GridView?



Feedback Appreciated,

-machina12

 
New Post
8/20/2007 1:33 PM
 



Trying to re-visit this post and shed some light on why I can only refresh a "non-dynamic" GridView?
Perhaps I am making up the termanology "non-dynamic", but it will help for understanding my issue.
I already have a GridView that is "non-dynamic", or not actively linked to DataSourceID. 
Meaning I cannot edit, delete or create from within a GridView like this.
Being able to refresh this GridView, which acts like a display of contents, is easy. I use this code:

Private Sub MyFunc(ByVal sender As Object, ByVal e As System.EventArgs)
Dim mySqlString As New
StringBuilder()
mySqlString.Append("SELECT * "
)
mySqlString.Append("FROM {databaseOwner}{objectQualifier}ModuleName "
)
mySqlString.Append("ORDER BY ClientName ASC"
)
Me.GridView2.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), Nothing
), IDataReader)
Me
.GridView2.DataBind()
End Sub

Yet, when I try to use this same method on the "Dynamic GridView", which allows for creating, editing & deleting data I get errors.
This GridView is linked to DataSourceID, therefore when running this same method and having linked to DataSourceID throws this error:

A critical error has occurred.
Both DataSource and DataSourceID are defined on 'GridView1'. Remove one definition.


Although I cannot run the "Dynamic GridView" without DataSourceID.
What code will refresh contents of "Dynamic GridView" within page_load, so that data in sql already appears and can be edited?


Feedback appreciated,

-machina12

 
New Post
8/20/2007 5:03 PM
 



Been looking into this issue.
GridViews without a DataSourceID, can easily be refreshed by doing a:  Me.GridView.DataBind()

But, GridViews with a DataSourceID will not refresh using that same method.
The DataSourceID is running off a standard Contoller.vb file.
*** It's almost like this GridView will display only the data that has been input after the module has been dropped.
So it almost seems like I should be calling for the DataSourceID to load its method named:    ModuleName_SelectAll

Without hardcoding the sql query, how can I call the controller.vb ModuleName_SelectAll or stored procedure ModuleName_SelectAll on page_load?
I am guessing this will grab all existing data, eliminating my GridView refresh issues.


Feedback appreciated,

-machina12

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Update/Refresh GridView?Update/Refresh GridView?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out