Advanced Forum Search Results
-
Hi,
I had used something similar to this in my application:
Customer c = ((Grid)((StackPanel)sender).Parent).DataContext as Customer;
But now that I have converted my application to Beta 2, I get the following error:
Unable to cast object of type 'System.Windows.Controls.ContentPresenter' to type ...
-
Thanks vsi. Your fix worked.
-
Okay. As of now I have commented the code. But when I try to add a new Datagrid control from the toolbox I get the above mentioned FORMATTEC error. And if I try to add the datagrid manually by typing in the XAML then I get the following error on compiling:
Error 1 Derived method 'OnApplyTemplate' in type ...
-
I had an existing project which I converted to Beta 2. I was using a datagrid in it but was getting a lot of erorrs. So I removed the datagrid and tried adding a new one. I got the following error:
"The operation could not be completed. Invalid FORMATETC structure"
-
The button just disappears
-
I will clarify myself.
I have button which needs to be moved when clicked. I tried doing this:
private void btnTest_Click(object sender, RoutedEventArgs e)
{
Button b1 = sender as Button;
b1.SetValue(Grid.ColumnProperty, 1);
b1.SetValue(Grid.RowProperty, 1);
b1.Content ...
-
That is what I was looking for. But I am still not able to move an already created element. I can create an element, I can remove it but not move it. I tried removing it and then adding it again. But it still did not work.
-
I meant through Coding during runtime. I want to move elements around in response to certain events?
-
How to position an element in Silverlight through Code Behind?
I am using a Grid and not a Canvas.