DynamicTileView Problem

4 posts, 0 answers
  1. shane
    shane avatar
    33 posts
    Member since:
    Jan 2009

    Posted 07 Dec 2009 Link to this post

    this is my code

    private void RadTileView1_Loaded(object sender, RoutedEventArgs e)  
            {  
                for (int i = 0; i < 6; i++)  
                {  
                    //外围框架  
                    RadTileViewItem ra = new RadTileViewItem();  
                    //标题元素  
                    TextBlock heahertext = new TextBlock();  
                    heahertext.Text = "正面吊";  
                    ra.Header = heahertext;  
                    //内部动画元件  
                    RadFluidContentControl rfcc = new RadFluidContentControl();  
                    AnimationManager.SetIsAnimationEnabled(rfcc, true);//允许动画  
                    //定义动画  
                    Size s1 = new Size(Double.Parse("291"), Double.Parse("130"));  
                    rfcc.SmallToNormalThreshold = s1;  
                    Size s2 = new Size(Double.Parse("292"), Double.Parse("131"));  
                    rfcc.NormalToSmallThreshold = s2;  
                    Size s3 = new Size(Double.Parse("730"), Double.Parse("350"));  
                    rfcc.NormalToLargeThreshold = s3;  
                    Size s4 = new Size(Double.Parse("731"), Double.Parse("351"));  
                    rfcc.NormalToLargeThreshold = s4;  
                    //边框  
                    Border rfccborder = new Border();  
                    //边框尺寸  
                    rfccborder.Height = Double.Parse("193");  
                    rfccborder.Width = Double.Parse("30");  
                    //  
     
                    //小图片  
                    TextBlock rfccsmallcontent = new TextBlock();  
                    rfccsmallcontent.Text = "详细参数";  
                    rfccborder.Tag = rfccsmallcontent;  
     
                    //  
     
                    //中等图片  
                    Image rfcccontent = new Image();  
                    rfcccontent.Source = new BitmapImage(new Uri("pic/1.jpg", UriKind.Relative));  
                    rfcccontent.HorizontalAlignment = HorizontalAlignment.Left;  
                    rfcccontent.VerticalAlignment = VerticalAlignment.Top;  
                    rfcccontent.Margin = new Thickness(13, 13, 0, 0);  
                    rfcccontent.Height = Double.Parse("130");  
                    rfcccontent.Width = Double.Parse("279");  
     
                    //  
     
                    //特写图  
                    Grid bigGrid = new Grid();//特写区域容器  
                    RowDefinition bigRowDF1 = new RowDefinition();//定义特写区域RowDefinition属性  
                    bigRowDF1.Height = GridLength.Auto;  
                    //RowDefinition bigRowDF2 = new RowDefinition();//定义特写区域RowDefinition属性  
                    //bigRowDF2.Height = ;  
                    bigGrid.RowDefinitions.Add(bigRowDF1);  
     
                    Image rfcclargecontent = new Image();//特写图  
                    rfcclargecontent.Source = new BitmapImage(new Uri("pic/1.jpg", UriKind.Relative));  
                    rfcclargecontent.HorizontalAlignment = HorizontalAlignment.Left;  
                    rfcclargecontent.VerticalAlignment = VerticalAlignment.Top;  
                    rfcclargecontent.Margin = new Thickness(11, 11, 16, 0);  
                    rfcclargecontent.Height = Double.Parse("156");  
                    rfcclargecontent.Width = Double.Parse("715");  
                    Grid.SetColumnSpan(rfcclargecontent, 3);//合并3行,并占据  
     
                    Border bigOutBorder = new Border();//特写图与文本外层间隔线  
                    Color bigOutBorderColor = new Color();  
                    bigOutBorderColor.R = (byte)Convert.ToInt32(string.Format("c9"), 16);  
                    bigOutBorderColor.G = (byte)Convert.ToInt32(string.Format("cd"), 16);  
                    bigOutBorderColor.B = (byte)Convert.ToInt32(string.Format("d2"), 16);  
                    SolidColorBrush bigOutBorderBrush = new SolidColorBrush(bigOutBorderColor);  
                    bigOutBorder.BorderBrush = bigOutBorderBrush;  
                    bigOutBorder.Margin = new Thickness(10, 190, 10, 20);  
                    bigOutBorder.VerticalAlignment = VerticalAlignment.Top;  
                    bigOutBorder.BorderThickness = new Thickness(0, 1, 0, 0);  
                    Grid.SetColumnSpan(bigOutBorder, 3);  
     
                    Border bigInnerBorder = new Border();//特写图与文本内层间隔线  
                    Color bigInnerBorderColor = new Color();  
                    bigInnerBorderColor.R = (byte)Convert.ToInt32(string.Format("c9"), 16);  
                    bigInnerBorderColor.G = (byte)Convert.ToInt32(string.Format("cd"), 16);  
                    bigInnerBorderColor.B = (byte)Convert.ToInt32(string.Format("d2"), 16);  
                    SolidColorBrush bigInnerBorderBrush = new SolidColorBrush(bigInnerBorderColor);  
                    bigInnerBorder.BorderBrush = bigInnerBorderBrush;  
                    bigInnerBorder.BorderThickness = new Thickness(0, 1, 0, 0);  
     
                    bigGrid.Children.Add(rfcclargecontent);  
                    bigGrid.Children.Add(bigOutBorder);  
                    //  
                    rfcc.SmallContent = rfccborder;  
                    rfcc.Content = rfcccontent;  
                    rfcc.LargeContent = bigGrid;  
                    ra.Content = rfcc;  
                      
                    RadTileView1.Items.Add(ra);  
                }  
            } 

    I cant find any problem,but the Real effect is unnormal, so what's wrong??
  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 09 Dec 2009 Link to this post

    Hello Shane,

    You have encountered a known issue which we are working on. It affects the initial rendering of TileViewItems which are added programmatically. A patch should be available in one of the coming internal builds.

    On a side note, you can use DataTemplates instead of creating manually all elements you want to put in the individual TileViewItems. This will save you a lot of coding and makes data binding much easier and maintainable.

    Kind regards,
    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Tyrin-J
    Tyrin-J avatar
    9 posts
    Member since:
    Apr 2008

    Posted 11 Dec 2009 Link to this post

    What is the basis for selectively responding to some questions. We also need answers to our questons. If we are unable to proceed with our evaluations, why should we purchase and continue to use your products?
  5. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 13 Dec 2009 Link to this post

    Hi Tyrin-J,

    Our policy is to reply to public forum posts within 72 hours. I already replied to your thread. Please do not post in threads if you are not interested in their respective topics.

    Regards,
    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top