GridView DataTemplate in dynamic xaml

3 posts, 0 answers
  1. lina fetisova
    lina fetisova avatar
    110 posts
    Member since:
    Apr 2010

    Posted 16 Jun 2010 Link to this post

    Good day!
    I have such a form:

    <Grid x:Name="LayoutRoot">
    <StackPanel x:
    Name="spQuestions" Orientation="Vertical" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="3" HorizontalAlignment="Left">
    </StackPanel>
    <
    /Grid>


    and I put there a RadGridView using xaml.cs file:

    RadGridView gridView = new RadGridView();
    gridView.ItemsSource = 
    question.Answers;
    gridView.AutoGenerateColumns = false;
    gridView.ScrollMode
     = Telerik.Windows.Controls.GridView.ScrollUpdateMode.RealTime;gridView.ShowGroupPanel = false;
    spQuestions.Children.Add(gridView);

    So I make my xaml dynamically.

    Is it possible to make someting like such structure usin dinamic xaml
    <telerikGridView:GridViewDataColumn Header="Варианты ответа" UniqueName="Name" MinWidth="300" MaxWidth="2000">
       <telerikGridView:GridViewDataColumn.CellTemplate>
           <DataTemplate>
              <RadioButton Content="{Binding Text}" FontFamily="Verdana" FontSize="13" Foreground="#FF170000" />
           </DataTemplate>
       </telerikGridView:GridViewDataColumn.CellTemplate>
    </telerikGridView:GridViewDataColumn>


    ?

  2. Vlad
    Admin
    Vlad avatar
    11043 posts
    Member since:
    Sep 2012

    Posted 16 Jun 2010 Link to this post

    Hi,

     Yes you can however it will be better if you create a custom column, inherit from desired column type, override CreateCellElement and return desired control(s). You can check this blog post for more info. 

    If you still want to know how to parse XAML dynamically you can check this blog post.

    Best wishes,
    Vlad
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  3. DevCraft Release
  4. lina fetisova
    lina fetisova avatar
    110 posts
    Member since:
    Apr 2010

    Posted 17 Jun 2010 Link to this post

    Vlad thank you very much!! =) That's great!

    but now I have enother problem - http://www.telerik.com/community/forums/wpf/gridview/datatemplate-with-radiobutton-in-dynamic-xaml.aspx

Back to Top