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
Solved

Datasource from codebehind?

Posted on 2011-02-25
5
724 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
  • 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 500 total points
ID: 35007368
0
 
LVL 40

Expert Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 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