Solved

Datasource from codebehind?

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

Expert Comment

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

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
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…

688 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