Solved

Datasource from codebehind?

Posted on 2011-02-25
5
719 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 39

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 39

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 35007368
0
 
LVL 39

Expert Comment

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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Expando 4 33
How can I use this extension method? 8 36
Form design in vb.net 7 18
Showdialog 8 20
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now