|
You'll need to bind the SelectedItem to a property on your view model. You should then be able to set the property from the code. Don't forget to notify property change
|
|
|
|
|
Hi together,
for a benchmark (WinForm - WPF) I want to measure the drawing time of an thrid party control (for WinForm and WPF available). Under WinForm I created a test project, derived the thrid party control and override the OnPaint and OnPaintBackground Method to measure the runtime. I just started programming in WPF, so I do not now who I can do this measureing under WPF. Does somebody have an idea?
thanks in anticipation
netsrak
|
|
|
|
|
Hi,
I am working on a Silver light application. In this I used WCF service. While using this service I am getting the below exceptions.
class: System.ServiceModel.CommunicationException.
Message: The remote server returned an error: NotFound.
It is saying like some error in the web config file that is no binding information is provided for the endpoint with name '*' in the config file.
If anyone have any ides to solve this please reply me.
Thanks in advance.
|
|
|
|
|
Nekkantidivya wrote: It is saying like some error in the web config file that is no binding information is provided for the endpoint with name '*' in the config file.
You can't post the EXACT error?
Are the endpoints configured properly on both ends?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I have to do printing of visuals say Grid contents, over multiple pages supporting basic printing functionalities like changing the margin, orientation ,paper size etc without invoking Print Dialog.
1. So should I use Custom Printing or Will Print document serve my purpose?
2. If Print document allows these features, please let me know how to convert the visual as a IDocumentPaginatorSource to pass it to the Print Document function?
Please reply asap...Very urgent... please provide sample code if you have...
|
|
|
|
|
How can i use ref key word on service class on silverlight application and get value of that reference type variable on .xaml page.
Please help.
-Raghvendr Singh
|
|
|
|
|
rag_Singh wrote: How can i use ref key word on service class
What kind of service? If WCF, see here:
Designing Service Contracts[^] ("Out and Ref Parameters" section)
rag_Singh wrote: get value of that reference type variable on .xaml page
What do you mean?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
My code is as bellow on services1.svc.cs page
[OperationContract]
public DataTable getEmpCode(System.DateTime dt1, System.DateTime dt2)
{
string s = "";
tbl1 = createTable();//tbl1 is a DataTable
//createTable() is a function which generating table and return it
db = new DataClasses1DataContext();
var objECode = from user in db.UserMgmts
where user.ProjectName == "WapCos"
select user;
//return objECode.ToList();
List<UserMgmt> l = objECode.ToList();
int intCount = objECode.Count();
for(int i = 0; i < intCount; i++)
{
drw1 = tbl1.NewRow();
drw1[0] = l[i].ECode.ToString();
s= getCost1(l[i].ECode.ToString(), dt1, dt2);
drw1[1] = s;
tbl1.Rows.Add(drw1);
}
return tbl1;
}
i want to retrive data of tbl1 on page.xaml.cs page by clicking any button.
|
|
|
|
|
First of all, Silverlight doesn't have a DataTable class...
Is this your own class?
Second, I don't see anything having to do with "ref" there.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Actually firstly i was using ref type variable since i had no idea of using ref keywords in silverlight so i changed my logics and used there DataTable but i came to knew from you that Silverlight don't have DataTable class.
Over all i am getting some data by Linq and kept it in DataTable after performing few manipulation.Function that creates DataTable is as bellow.(all code are written on Services1.svc.cs page)
public DataTable createTable()
{
DataTable tbl2 = new DataTable("UserCost");
DataColumn DC0 = new DataColumn("DT_ECode");
DataColumn DC1 = new DataColumn("DT_Area");
tbl2.Columns.Add(DC0);
tbl2.Columns.Add(DC1);
return tbl2;
}
To create DataTable I add using System.Data; namespace
Function that performs operation and keeps data in a table is:
public DataTable getEmpCode(System.DateTime dt1, System.DateTime dt2)
{
string s = "";
tbl1 = createTable();//tbl1 is a DataTable
db = new DataClasses1DataContext();
var objECode = from user in db.UserMgmts
where user.ProjectName == "WapCos"
select user;
//return objECode.ToList();
List<UserMgmt> l = objECode.ToList();
int intCount = objECode.Count();
for(int i = 0; i < intCount; i++)
{
drw1 = tbl1.NewRow();
drw1[0] = l[i].ECode.ToString();
s= getCost1(l[i].ECode.ToString(), dt1, dt2);
//s is some manipulated value against every ECode by another function
//getCost1(string empCode,date1,date2){some codes...}
drw1[1] = s;
tbl1.Rows.Add(drw1);
}
return tbl1;
}
My objective is to use tbl1 data on Page.xaml.cs page.Then what should be another way to use this tabular data on Page.xaml.cs page instead of DataTable.
modified on Wednesday, November 11, 2009 12:37 AM
|
|
|
|
|
rag_Singh wrote: what should be another way to use this tabular data on Page.xaml.cs page instead of DataTable.
Using LINQ to Dataset to reshape the data into types that are compatible
with Silverlight is popular.
There's also ADO.NET Data Services[^] and
RIA Services[^].
RIA services is not officially released yet, but it has a go-live license.
It's currently my favorite platform for n-tier Silverlight development as it
works nicely with ASP.NET services.
I recommend searching on "Silverlight DataTable", "Silverlight DataSet" or similar.
There's lots of info and examples floating around, like this[^].
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How is the idea of Writing and Reading xml file.
My mean Writing data of DataTable in xml file from services1.svc.cs
page and again Reading that xml data from page.xaml.cs page.
i want your best suggetion..
|
|
|
|
|
I prefer to use strong types where possible so my preference is
WCF or RIA Services.
But there's nothing wrong with Plain Old XML (POX).
Unfortunately Silverlight doesn't have binding-to-xml (XPath)
features so you may need to use something like LINQ to XML on
the client end to translate the XML into typed objects for binding.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I want to replace the 'plus', 'minus', 'blank' icons for the expand/collapse button of a TreeViewItem with my own images. Can that be set by defining a style? If so, does anyone have an example?
While on the discussion of element styles, where does one find the default styles and templates applied to various Controls?
modified on Saturday, November 7, 2009 12:21 PM
|
|
|
|
|
Already found what I was looking for. For anyone else, this might help:
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/wpf_conceptual/html/6bea1014-2555-425c-9f79-3f31a487bab3.htm
|
|
|
|
|
|
Cute.
I've never heard of the term "fun badge", so I looked it up.
Fun Badge[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If you are accessing through HTTP you need to provide a clientaccesspolicy.xml in the root of the site.
My question is for the TCP access, it appears you must setup a TCP listener on the TCP address where Silverlight is accessing on port 943. Correct?
It has nothing to do with the hosting web server. Right?
Thanks
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
earlgraham wrote: If you are accessing through HTTP you need to provide a clientaccesspolicy.xml in the root of the site.
Only if you'll be accessing resources on a domain other than the
one the Silverlight app is hosted on. Then the target domain must
have the policy file at its root.
earlgraham wrote: It has nothing to do with the hosting web server. Right?
Correct. You have to supply the server code (listening on port 943)
that returns the policy information.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am currently developing the application I asked about earlier and when I run (debug mode) the application I get the security exception, So I go to the properties and set the security setting to full trust and that solved the problem. Now when I deploy the application to localhost I get Trust Not Granted so I was wandering how to solve this problem so that I can move on with Implementing the other design items?
|
|
|
|
|
Never mind I found a couple of solutions
1. Link[^]
2. Link[^]
3. Link[^]
4. Link[^]
Hope this helps anyone facing the same problem
|
|
|
|
|
And how can I get rid of it? I've been able to remove the RowHeader on the left side but the upper left hand corner remains.
While I am at it, I've data binded my DataGrid to an observable collection and when the collection is empty, I get a weird error where that upper left hand corner of the DataGrid begins to stretch all the way to the right and locks the program up. It seems to be stuck on a "OnResize" event in according to the disassembly.
|
|
|
|
|
Can you post a simple example that shows what you are referring to?
I don't see anything on my DataGrids in the upper left corner,
but my property settings could be vastly different than yours.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Image of what I'm speaking of
What my big problem is when I have an empty collection in my data binding, this area area stretches all the way to the right and locks up my program completely. It's stuck in a response to OnResize event I believe, but I'm not entirely sure why an empty collection would cause this.
|
|
|
|
|
I appreciate the picture but I meant a code sample
I have no idea what kind of collection you're binding to
or how you are configuring the DataGrid.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|