?
Solved

Datasource from codebehind?

Posted on 2011-02-25
5
Medium Priority
?
727 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 40

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 40

Accepted Solution

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

Expert Comment

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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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