Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Datasource from codebehind?

Posted on 2011-02-25
5
Medium Priority
?
728 Views
Last Modified: 2012-05-11
Hi,
How to call a datasource from the codebehind?
Like using this sample:

 <dxwgv:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="masterDataSource" KeyFieldName="CustomerID" Width ="100%">

 <% 
 -- BeginRegion Grid Columns --
%> <Columns
 

 <dxwgv:GridViewDataColumn FieldName="ContactName" VisibleIndex="0" />
<dxwgv:GridViewDataColumn FieldName="CompanyName" VisibleIndex="1" />
 
<dxwgv:GridViewDataColumn FieldName="City" VisibleIndex="2" />
 
<dxwgv:GridViewDataColumn FieldName="Country" VisibleIndex="3" />
 
</Columns>
 
 </dxwgv>

Open in new window


 Thank you in advance.
0
Comment
Question by:DistillingExperts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 34979846
DataSourceID="masterDataSource"

so it should be just

masterDataSource.
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34979954
Do you want to rebind the gridview in the codebehind ?
if so :

grid.Bind()
0
 

Author Comment

by:DistillingExperts
ID: 34979961
I want to create the whole process to get the datasource inside the code behind, using a model from MVC.
0
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 35007368
0
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 35036487
Do you need further assistance?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question