Skip to main content

Answered Question Encapsulate Silverlight (DataGrid control) with ASP.NET ControlsRSS Feed

(0)

dotnetmac
dotnetmac

Member

Member

28 points

19 Posts

Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

Hi All,

I need to create a silverlight DataGrid control from ASP.NET. I am able to create normal controls like button and canvas, but unable to create any control derived from System.Windows.Controls. Basically i need to bind the DataGrid control with data from my ASP.NET app.

 Please help !!!

Nokola
Nokola

Member

Member

66 points

13 Posts

Microsoft

Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

Hi dotnetmac,

What happens when you try creating the controls? Do you get an error message? What is the failure message/dialog/error text that you're seeing?

btw maybe the issue is with System.Windows.Controls.Data because Button is from the System.Windows.Controls namespace.

-------
Please mark this post as answer if it answers your question!
Nikola - MSFT
http://blogs.msdn.com/nikola

dotnetmac
dotnetmac

Member

Member

28 points

19 Posts

Re: Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

Hey bro,

it was just a canvas which was used to create a button in 1.1. Now with new System.Windows.Controls how do i create these controls from an ASP.NET application

Nokola
Nokola

Member

Member

66 points

13 Posts

Microsoft

Re: Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

If you're creating a new application, these are the steps to add a DataGrid to it:

1. In VS, click create New Project, select C# (or VB), select Silverlight, Click Silverlight Application on the right then OK

2. Open Page.xaml

3. Drag-drop DataGrid from the toolbox inside the XAML <Grid></Grid> tags, same with Button, etc

Did this resolve the issue?

-------
Please mark this post as answer if it answers your question!
Nikola - MSFT
http://blogs.msdn.com/nikola

dotnetmac
dotnetmac

Member

Member

28 points

19 Posts

Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

Ho do i set the datasource from an ASP.NET application ?

dotnetmac
dotnetmac

Member

Member

28 points

19 Posts

Re: Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

Hi there,

Still waiting for ur reply, please help

Nokola
Nokola

Member

Member

66 points

13 Posts

Microsoft

Re: Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

This page provides few samples for DataGrid, one of them is setting the data source for the grid:

http://msdn2.microsoft.com/en-us/library/cc189058(vs.95).aspx

This is the sample that shows how to bind the DataGrid to data: DataGrid..::.ItemsSource

 

-------
Please mark this post as answer if it answers your question!
Nikola - MSFT
http://blogs.msdn.com/nikola

dotnetmac
dotnetmac

Member

Member

28 points

19 Posts

Re: Re: Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

Bro,

I wanted to sent the datasource from an ASP.NET page. Thats why i thought of dynamically creating the datagrid xaml from an ASP.NET page, which i couldn't succeed. Please help me in dynamically creating xaml from ASP.NET page for an controls under System.Windows.Controls or how do i set the properties of silverlight controls from an ASP.NET page, espicially for a DataSource property.

Thank you very much for your time in responding. You doing a favor to all of us. espicially me :))

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25068 points

2,749 Posts

Answered Question

Re: Re: Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

Unfortunately you can only create XAML on the server that doesn't require client code behind. You can't set data source or use any data binding on these XAML pieces. You have to assign the data source and create data binding on client in code after you use XamlReader.Load to load the content. But why do you want to do so? Silverlight is designed to work with asynchronously calling web services mode, not post back mode. Don't put everything on the server. Try to move more and more to the client. You should call a web service to get data on the client, and then create a data source. No need to dynamically create the XAML. That'll save you a lot of efforts.

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

dotnetmac
dotnetmac

Member

Member

28 points

19 Posts

Re: Re: Re: Re: Encapsulate Silverlight (DataGrid control) with ASP.NET Controls

Thanx bro,

If this is the actual way of doing it, then i will. Thanx for your effort and time

  • Unanswered Question
  • Answered Question
  • Announcement