.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How do I use Storyboarb.Children.IndexOf()

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :WPF
I have a storyboard in a resource that has many child DoubleAnimations, a few of which have a name assigned. These DoubleAnimations may need to have thier To property adjusted based on some user settings during run time. What I am trying to figure out, is how to retrieve the DoubleAnimation from the Storyboard,Children collection from it's Name. How can I use Storyboard.Children.IndexOf() to get the index of the DoubleAnimation who's Name is "P1Bf" then modify the To property of that DoubleAnimation. Here's the storyboard resource: <Storyboard x:Key="Fold"> <!-- Fold panel 1 from 90 to 0. --> <DoubleAnimation Storyboard.TargetName="RSC_PanelGroup1_Rotation" Storyboard.TargetProperty="Angle" To="0" Duration="0:0:0.5"/> <!-- Fold panel 2 from 90 to 0. --> <DoubleAnimation Storyboard.TargetName="RSC_Panel1and2Group_Rotation" Storyboard.TargetProperty="Angle" To="0" Duration="0:0:0.5" BeginTime="0:0:0.5"/> <!-- Fold glue tab from 0 to -90. --> <DoubleAnimation Storyboard.TargetName="GlueTab_Rotation" Storyboard.TargetProperty="Angle" To="-90" Duration="0:0:0

View Complete Post

More Related Resource Links

Treeview: Select all children if Parent is selected etc...



I'm using a Treeview with  ShowCheckBoxes="All" , so basically I have a tree with all CheckBox Nodes. I'm using the TreeView inside an update panel, and populate the Tree code behind dynamically.

My requrements are the following:

1) Select all the children if parent is selected,

2) When parent is selected, and if we de-select a child, set parent unselected

3) Track if new nodes were selected and previously selected nodes were de-selected (becasue I need to update the database according to the selections in the Tree)

For above 1, I do the following:

protected void TreeView1_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
        foreach (TreeNode node in TreeView1.Nodes)
            TreeNodeCollection col = node.ChildNodes;
            //select all children when the parent is checked
            if (col != null && node.Checked)

How to center children divs?

I am trying to center children divs which floated left by using margin: 0 auto 0 auto. It did not work. Is there any way to center them?  thanks. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="DIVAlignment.aspx.vb" Inherits="Test_DIVAlignment" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> xmlns="http://www.w3.org/1999/xhtml"><head runat="server">    <title></title>    <style type="text/css" >    #formContainer{     width:600px;          margin:0 auto 0 auto;    }    #formContainer #caption{     font-size: medium;     font-weight: bold;     text-align:center;    }         #formContainer .MetaTitle{      float: left;       margin-left:20px;       width:80px;       text-align:left;       font-weight:bold;       background-color: #cc6633;  &

How to set Panel.Zindex value though XAML code if any of the Grid/UserControl children having the fo

Hi, I have a Grid with 10 buttons. If any of these buttons has focus then I want to set the Panel.Zindex = 999 for the Grid. How to do this in XAML code?Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This will help other members to find the solution easily.

Excel 2003 pivot table - parent showing grand total than the sum of its children

All, In Excel 2003, I have a product hierarchy, for simplistic sake lets say it goes A > B > C > model nbr.  I have filtered on model nbr 1.  I have the product hierarchy in my pivot table and unit cnt as the measure. Starting at level A in the hierarchy I am showing a total unit of 12000, if I drill down to B it still shows 12000, if I drill down to C it shows 100 and if I drill down to model nbr it shows me model nbr 1 with a unit cnt of 100. So my question is why are my parents not filtering the model nbr, it is taking the total for ALL records that have level A as their parent regardless of the model nbr? This does NOT happen in Excel 2007 or when I browse my cube in SSAS.

Wizard Control set WizardStep.IndexOf() Programmatically

How can I set the value of WizardStep.IndexOf() programatically? eg.Dim strWizStep As ?? = "Me.wiz1_Step" & Session("arSteps").Item(h+1) 'ie. Me.wiz1_Step3 or Me.wiz1_Step4 etc wiz1.ActiveStepIndex = wiz1.WizardSteps.IndexOf(strWizStep)

mdi children from always goes under mdi parent controls

hi there in my application i have a mdi container and some mdi children forms. i putted some controls i mdi container but when i show mdi child form, the form goes behind the mdi parent controls and some part were not shown!!!! how to solve this?

mdi children from always goes under mdi parent controls

hi there in my application i have a mdi container and some mdi children forms. i putted some controls i mdi container but when i show mdi child form, the form goes behind the mdi parent controls and some part were not shown!!!! how to solve this?

Problem with IndexOf function in Java script?


Hi all,  i have one problem while using Index Of function in java script. I am using this in this way:

var ss=(document.getElementById('<%=HiddenField1.ClientID%>').value.indexOf(","+document.getElementById('<%=yyy.ClientID%>').value+"-"+document.getElementById(str).value,20));                       

Move all children on canvas or preferrably move the entire canvas



I´m working on a small app that parses the gpx file from the GPS. It will animate how me and my dog moves when we go hunting. I want to zoom in so that I can analyse how the dog is working and therefore need the graph to scroll and keep my position centered.

Yesterday I used a Canvas and plotted my points as black rectangles and the dog as red rectangles. Then used the SetLeft and SetTop to scroll the Canvas. I then added a polyline connecting the dogs points but didnt find StLeft and SetTop for the polyline. Played around with RenderTransform but never got it working.

1. My question is is canvas suitable for this?

2. Is there a way to move the entire canvas and all its children in one command?

3. Is there a generic way that can be used to move all UIElements.

By move I mean move relative an element relative to its current position, for example 2 pixels left and 5 pixels up.



Trying to learn

Many Parents Many Children relationship


OLAP - I have in RDBMS(Data Warehouse) -  ParentId and ChildId are TypeId's

ParentId and ChildId have many to many relationship. One parent can have many children(TypeIds) and same way One ChildId can have multiple parents(TypeIds)

Table A
TypeId (PK)

Table B

TypeId (FK)

How will I design a OLAP solution for these tables - what are my dimension and its hierarchy?

I want to display for All Parents->All Children->Measure(Values), DateTime


.NET 4 Performance Issue String IndexOf



I have a performance issue with the new dot net 4.0 framework.

When i use the function String.IndexOf(string, stringcomparison.ordinalignorecase) my execution time is much higher than framework 3.5 (i had 30ms in a loop for 3.5 and 210ms in framework 4)

All other StringComparison mode are really good in framework 4.

Is there an explanation?

Zooming in/out on canvas: how to leave some children unscaled?


I'm working with Visual Studio 2008 and I have created a window with a Canvas in a ScrollViewer. On the canvas, I've placed an image and the code I've written places buttons on the canvas at certain locations. So far, so good, but I'm trying to implement a zooming method which scales the canvas and the image, but leaves the buttons intact in terms of size and content -- however, their location should scale together with the image and the canvas.
What I have thusfar is this:

private void zoomIn(Object sender, MouseButtonEventArgs e)
  mapCanvas.Width *= ZoomFactor;
  mapCanvas.Height *= ZoomFactor;
  Zoom *= ZoomFactor;
  TransformGroup transform = new TransformGroup();
  transform.Children.Add(new ScaleTransform(Zoom, Zoom));
  transform.Children.Add(new TranslateTransform(0, 0));
  mapCanvas.RenderTransform = transform;

This, together with an analogue zoomOut method, works like a charm, but the buttons are scaled as well, obviously because RenderTransform is applied to every child of the canvas as well.

My question is: how can I leave the buttons unscaled?

How to execute a formula through all children measure's values in the current context


Hi, I have a cube with the following dimensions and measures:


The [Answer] measure is a integer value between 0 and 10.
My goal is to create a custom calculated member that return's the answer that
most appears in the current context. I don't know the correct math function's
name in english, but in portuguese is called as "MODA".

I've used the following sintaxe to calculate the STDEVP and I need to
reproduce some similar behavior that the STDEVP internaly's uses to navigate
through all children values and calculate the standard deviation:
STDEVP( [DimAnswer].Children, [Measures].[Answer])

Could someone please help me?

Oberdan Borges Nunes

TabContainer cannot have children of type 'System.Web.UI.WebControls.TextBox'.


I keep receiving the following error: TabContainer cannot have children of type ...    Below is the page

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <cc1:TabContainer ID="TabContainer1" runat="server">

hierarchyid - any thoughts on grouping children across multiple parents


Hey there,

I have just been playing around with the hierarchyid examples on MSDN and came across this issue in my experiments and wondered whether anyone has any thoughts on creating some sort of "grouping" of child nodes across different parents:

If I have the following two tree items:



The two DVD nodes aren't associated by anything other than a common title which makes it difficult to search for all DVDs so you could change the structure to this:


but then the problem rears it's ugly head in the same fashion when you add more data:


Now there are two Music and Movie nodes that are loosely associated by a common title.


I am not suggesting that the hierarchyid should be able to represent data like this and it is still useful for strictly hierarchical models I just wondered whether anyone had come up with a solution that overcomes this problem. My initial thoughts are that you could

Drag-move canvas and its children


With VS2008, I have created a Canvas in a ScrollViewer, in which I place an Image which I overlay with Buttons and StackPanels. This far, everything works as I'd want to, but my next challenge is to implement a drag-move behavior where the user can click on the Image and drag it in every direction. I figured out how I should move just the Image, but the problem is that the Buttons and StackPanels stay in place, where I really want them to be moved with Image as well. Trying to convert the drag-the-Image-method to a sort of drag-the-Canvas one did not work out for me.

So my layout is structured like this:

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend