|
I am using <navigation:Page for my silverlight pages.
Where do I place the resources on this page?
I have used usercontrols before and used to place the <usercontrol.Resources> inside the usercontrol page.
But not sure where to place the resources if I use navigation pages. These navigation pages are created using silverlight page items in silverlight 4
Any thoughts please?
thanks
|
|
|
|
|
Hhi,
In the following xaml, you see that I am showing the Address field when a row of datagrid is clicked on.
Question:
I have a datagrid2 which I would like to be placed instead of the Address field.
At present I am using the event:
datagrid1_RowDetailsVisibilityChanged to populate datagrid2 for the selected row in datagrid1
How do I replace the address field with the datagrid2 please? Can I place something like <datagrid2></datagrid2> instead of the <TextBlock Text="{}"... ?
Thanks
<data:DataGrid.RowDetailsTemplate>
<DataTemplate>
<Border>
<Border>
<TextBlock Text="{Binding Address}" TextWrapping="Wrap"></TextBlock>
</Border>
</Border>
</DataTemplate>
</data:DataGrid.RowDetailsTemplate>
|
|
|
|
|
This[^] may help.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Not sure what you are referring to.
Please explain.
|
|
|
|
|
Are you not looking for a datagrid within a datagrid?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
|
If not, then I have misunderstood your question.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
If I have a dynamically created OdbcDataReader, how do I hook it to the ListView in order to display the contents?
I already have the columns defined, and I just want to display the records from the data reader.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I figured it out:
Set the ListView.ItemsSource to the DataReader, and in XAML, set the Binding Path property of each column to its associated database field name.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard Andrew x64 wrote: Set the ListView.ItemsSource to the DataReader
I would consider this dangerous as the data reader locks the connection to the database while it is in scope, therefore you should move your data to an List<> of objects and bind that list to the xaml.
Your UI should be separated from your database object.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks, I changed it to be just as you said.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hello,
I have a silverlight application which is hosted within a WCF for purposes of getting at the data access layer. I am trying to convert a UI element on the silverlight side to an image using WriteableBitmap. However whenever I hit .pixels I get a protected error. Most of my research is telling me that this is a cross domain issue, but the WCF is hosted within the WCF and shouldn't that mean they are on the same domain.
Thanks so much for any feed back you can give.
Thanks,
Derek
|
|
|
|
|
You will need the client access policy or crossdomain file.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Hello,
I do have these files on the root of the WCF project. And just to be sure I also put them in the root of inetpub www. But I still get the erro: "WriteableBitmap has protected content. Pixel access is not allowed."
Is it possible that these files are not being utilized?
Thanks,
Derek
|
|
|
|
|
geoderek wrote: Is it possible that these files are not being utilized?
This might be a security issue.
If you run this project with elevated permissions, it might work.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
How is it possible to stop the selectionchanged event to get fired the first time the grid is loaded with data?
|
|
|
|
|
Set up a way to eat the event during databinding?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Not sure what else to do as I have tried -= and +=
Any further thoughts please?
|
|
|
|
|
A slightly more detailed response with the same concept that JSOP offered.
Set a bool (bLoading) in the constructor of the view
in the event check for the bool setting and ignore if bLoading == true
set bLoading to false at the end of the constructor.
Caveat I do this in winforms and assume it works in SL, I have not yet needed it in SL
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That will not work because the onstructor only gets called once.
|
|
|
|
|
Then you need to locate the method that populates the grid, probably the onchange event on your list and use the same logic.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The section which populate sthe grid is in the load events.
Please look at my earlier post to see the code events I am using.
Still having t he same problems...
|
|
|
|
|
I am working on an existing silverlight 4 application.
main page is MainPage.xaml
This page has a main datagrid i.e. datagrid1 and another datagrid i.e. datagrid2 which is inside the datagrid1.
When the application is run, the datagrid1 is populated with data.
Everytime you click on a row in datagrid1, then the datagrid2 is shown and is loaded with data.
Problems is everytime the datagrid1 is loaded, i.e. when th emainpage.xaml is run, then datagrid2 gets shown in the first row of datagrid1.
How can I stop the datagrid2 being shown when the mainpage.xaml is loaded?
I think somehow I have to get the -= and += code to work. You see them above where they are commented because they do not compile.
Any thoughts please?
for datagrid1 I am using the following events with codes inside them:
private void datagrid1_Loaded(object sender, RoutedEventArgs e)
{
//this.datagrid1.SelectionChanged -= new EventHandler(this.datagrid1_SelectionChanged);
this.DataContext = ((MainPage)(Application.Current.RootVisual)).GetData;
//this.datagrid1.SelectionChanged -= new EventHandler(this.datagrid1_SelectionChanged);
}
private void datagrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (datagrid1.RowDetailsVisibilityMode == DataGridRowDetailsVisibilityMode.Collapsed && e.RemovedItems.Count == 1)
datagrid1.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.VisibleWhenSelected;
}
private void datagrid_RowDetailsVisibilityChanged(object sender, DataGridRowDetailsEventArgs e)
{
if (e.Row.DetailsVisibility == Visibility.Collapsed) return;
if (e.Row.DataContext is myservice.myData)
{
//retrieve data
}
}
Thanks
modified on Thursday, December 9, 2010 9:49 AM
|
|
|
|
|
I create in the code some image control and i want to set on this image control some of the picture that i saved ( load those pictures before creating the image control )
How can i do it ?
|
|
|
|
|