<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Binding different lists to different rows in DataGrid in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/binding-different-lists-to-different-rows-in-datagrid/m-p/12723125#M5798</link>
    <description>&lt;P&gt;I did the same, here is how my ProfileItem class looks like (there are many rows below of initializing the 2 lists):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class ProfileItem
{
    public string ProfileName { get; set; }
    public bool IsRound { get; set; }
    public string ProfileType { get; set; }
    public Element ProfileElement { get; set; }

    public List&amp;lt;string&amp;gt; ProfileTypeList
    {
        get { return IsRound ? roundProfileTypeNames : rectProfileTypeNames; }
    }


    public List&amp;lt;string&amp;gt; rectProfileTypeNames = new List&amp;lt;string&amp;gt;();
    public List&amp;lt;string&amp;gt; roundProfileTypeNames = new List&amp;lt;string&amp;gt;();

    public ProfileItem(string name, Element elem)
    {

        this.ProfileName = name;
        this.ProfileElement = elem;
        rectProfileTypeNames.Add("RHS 50x30 / 2.6");
        rectProfileTypeNames.Add("RHS 50x30 / 3.2");
        rectProfileTypeNames.Add("RHS 50x30 / 4");
        rectProfileTypeNames.Add("RHS 50x30 / 5");
   ...
   ...
   }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also add ItemsSource="{Binding ProfileTypeList}" to my xaml file:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;DataGrid Name="profilePropsGrid" Width="500" CanUserReorderColumns="False" HorizontalAlignment="Center" CanUserAddRows="False" VerticalAlignment="Top" AutoGenerateColumns="False"&amp;gt;
    &amp;lt;DataGrid.Columns&amp;gt;
        &amp;lt;DataGridTextColumn Header="Profile Name" Width="*" Binding="{Binding ProfileName}" IsReadOnly="true" /&amp;gt;
        &amp;lt;DataGridTemplateColumn Header="Is Rounded Profile?" Width="*" &amp;gt;
            &amp;lt;DataGridTemplateColumn.CellTemplate&amp;gt;
                &amp;lt;DataTemplate&amp;gt;
                    &amp;lt;CheckBox IsChecked="{Binding Path=IsRound}" Checked="IsRoundChecked" Unchecked="IsRoundUnchecked" /&amp;gt;
                &amp;lt;/DataTemplate&amp;gt;
            &amp;lt;/DataGridTemplateColumn.CellTemplate&amp;gt;
        &amp;lt;/DataGridTemplateColumn&amp;gt;
        &amp;lt;DataGridComboBoxColumn Width="100" Header="Profile Type" x:Name="ProfileType" 
             SelectedValueBinding="{Binding Path=ProfileType}"  
             ItemsSource="{Binding ProfileTypeList}"
            DisplayMemberPath="{Binding ProfileType}" /&amp;gt;
    &amp;lt;/DataGrid.Columns&amp;gt;
&amp;lt;/DataGrid&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now my ProfileType column shows me empty lists in all DataGrid rows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrahi_amir_0-1713696060984.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1352623i3E325532D229B694/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrahi_amir_0-1713696060984.png" alt="mizrahi_amir_0-1713696060984.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can see in my ProfileItem class that ProfileTypeList shows "0 references":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrahi_amir_1-1713696121269.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1352624iD91D63CE5BB0495C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrahi_amir_1-1713696121269.png" alt="mizrahi_amir_1-1713696121269.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the binding doesn't take place. Isn't it?&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2024 10:43:41 GMT</pubDate>
    <dc:creator>mizrachi_amir2</dc:creator>
    <dc:date>2024-04-21T10:43:41Z</dc:date>
    <item>
      <title>Binding different lists to different rows in DataGrid</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/binding-different-lists-to-different-rows-in-datagrid/m-p/12722925#M5796</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this question is more WPF oriented but I am still posting it in this forum.&lt;/P&gt;&lt;P&gt;I am &lt;STRONG&gt;not using MVVM&lt;/STRONG&gt; yet and am trying to bind different list to different row in DataGrid.&lt;/P&gt;&lt;P&gt;I have 2 lists:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private List&amp;lt;string&amp;gt; roundProfileTypeNames;
private List&amp;lt;string&amp;gt; rectProfileTypeNames;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I have a DataGrid as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrahi_amir_0-1713680617016.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1352578i30BBA5D5D28F9656/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrahi_amir_0-1713680617016.png" alt="mizrahi_amir_0-1713680617016.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Each row contains a profile name + a checkbox which is checked if profile is rounded (taken from a parameter in the profile type) + a list of profile types which should be taken from the 2 lists above:&lt;/P&gt;&lt;P&gt;If "Is Rounded Profile" is checked then "Profile Type" should be binded to roundProfileTypeNames list, otherwise (unchecked) it should be binded to rectProfileTypeNames.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I was only able to bind all rows to the same list (roundProfileTypeNames OR rectProfileTypeNames).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my datagrid in xaml file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;DataGrid Name="profilePropsGrid" Width="500" CanUserReorderColumns="False" HorizontalAlignment="Center" CanUserAddRows="False" VerticalAlignment="Top" AutoGenerateColumns="False"&amp;gt;
    &amp;lt;DataGrid.Columns&amp;gt;
        &amp;lt;DataGridTextColumn Header="Profile Name" Width="*" Binding="{Binding ProfileName, Mode=TwoWay}" IsReadOnly="true" /&amp;gt;
        &amp;lt;DataGridTemplateColumn Header="Is Rounded Profile?" Width="*"&amp;gt;
            &amp;lt;DataGridTemplateColumn.CellTemplate&amp;gt;
                &amp;lt;DataTemplate&amp;gt;
                    &amp;lt;CheckBox IsChecked="{Binding IsRound}" Checked="IsRoundChecked" Unchecked="IsRoundUnchecked" /&amp;gt;
                &amp;lt;/DataTemplate&amp;gt;
            &amp;lt;/DataGridTemplateColumn.CellTemplate&amp;gt;
        &amp;lt;/DataGridTemplateColumn&amp;gt;
        &amp;lt;DataGridComboBoxColumn Width="100" Header="Profile Type" x:Name="ProfileType" 
             SelectedValueBinding="{Binding ProfileType, Mode=TwoWay}"  
            DisplayMemberPath="{Binding ProfileType}" /&amp;gt;
    &amp;lt;/DataGrid.Columns&amp;gt;
&amp;lt;/DataGrid&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is a snippet from my xaml.cs file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;bridgeProfileList = new List&amp;lt;ProfileItem&amp;gt;();

foreach (Element elem in framingPipeTypesCol) // Iterating through all framing pipe types in Revit
{
    ProfileItem ep = new ProfileItem()
    {
        ProfileName = elem.Name,
        ProfileElement = elem
    };
    IList&amp;lt;Parameter&amp;gt; pipe_shape_circle = elem.GetParameters("Pipe Shape_Circle");
    if (pipe_shape_circle.Count &amp;gt; 0)
    {
        int pipe_shape = pipe_shape_circle[0].AsInteger();
        if (pipe_shape == 0)
        {
            ep.IsRound = false;
            //ProfileType.ItemsSource = rectProfileTypeNames;

        }
        if (pipe_shape == 1)
        {
            ep.IsRound = true;
            //ProfileType.ItemsSource = roundProfileTypeNames;

        }
    }
    bridgeProfileList.Add(ep);
    Debug.WriteLine(elem.Name);
}
profilePropsGrid.ItemsSource = bridgeProfileList;
ProfileType.ItemsSource = roundProfileTypeNames;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I bind the correct list if checkbox is checked/unchecked?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 06:41:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/binding-different-lists-to-different-rows-in-datagrid/m-p/12722925#M5796</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-04-21T06:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Binding different lists to different rows in DataGrid</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/binding-different-lists-to-different-rows-in-datagrid/m-p/12722989#M5797</link>
      <description>&lt;P&gt;I don't know WPF myself, so I asked Meta AI for you. It replies:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="x1yztbdb"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel xt4736n x1havqas x1f0sm9e xrg5i2u xzsf02u x1yc453h xudqn12 x3x7a5m"&gt;To achieve this, you can create a property in your &lt;CODE&gt;ProfileItem&lt;/CODE&gt; class that returns the correct list based on the &lt;CODE&gt;IsRound&lt;/CODE&gt; property. Here's an example:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x1yztbdb"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel xt4736n x1havqas x1f0sm9e xrg5i2u xzsf02u x1yc453h xudqn12 x3x7a5m"&gt;In your &lt;CODE&gt;ProfileItem&lt;/CODE&gt; class, add a property like this:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x10394xv xmymobo x1lfhtmy x9puuxd x1a2cdl4 xnhgr82 x1qt0ttw xgk8upj x13fuv20 xu3j5b3 x1q0q8m5 x26u7qi x178xt8z xm81vs4 xso031l xy80clv x11ujt6w x6ikm8r x10wlt62 x889kno x1iji9kk x1a8lsjc x1sln4lm x2bj2ny x1yztbdb"&gt;
&lt;DIV class="x1n2onr6 x1ja2u2z x9f619 x78zum5 xdt5ytf x2lah0s x193iq5w"&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x1iyjqo2 x2lwn1j"&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x2lah0s x193iq5w x14l7nz5 xyorhqc"&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 x1r8uery x1iyjqo2 xs83m0k xeuugli x1qughib x6s0dn4 xozqiw3 x1q0g3np xcud41i x139jcc6"&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x193iq5w xeuugli x1r8uery x1iyjqo2 xs83m0k x150jy0e x1e558r4 xl56j7k x1hshjfz"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel x1qo61fq x81x36d xa4e6wy x31b0c2 xi81zsa x1yc453h xudqn12 x3x7a5m"&gt;&lt;SPAN class="x1lliihq x193iq5w x6ikm8r x10wlt62 xlyipyv xuxw1ft"&gt;C#&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x2lah0s x193iq5w xeuugli x150jy0e x1e558r4"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x193iq5w x1l7klhg x1iyjqo2 xs83m0k x2lwn1j xzboxd6 x14l7nz5"&gt;
&lt;PRE class="x1mqxbix xjup8qr x9f619 x1mocir3 x1ov8dlk xrv4cvt xdpxx8g x1sdyfia xp3md9m x1lldw8n xp5j34i x1evy7pa x1k5ss6i xuix1fa xwp6svo x1v60uq5 x159lptv x11uu2j1 xw2csxc x1odjw0f x1lq5wgf xgqcy7u x30kzoy x9jhf4c xdj266r x11i5rnm xat24cr x1mh8g0r"&gt;&lt;CODE class="xjup8qr xl0teqc xab0eaz x6d3u8q x1un5nx7"&gt;&lt;SPAN class="xuc5kci"&gt;public&lt;/SPAN&gt; &lt;SPAN class=""&gt;List&lt;SPAN class="x1noocy9"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="xuc5kci"&gt;string&lt;/SPAN&gt;&lt;SPAN class="x1noocy9"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; ProfileTypeList
&lt;SPAN class="x1noocy9"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="xuc5kci"&gt;get&lt;/SPAN&gt; &lt;SPAN class="x1noocy9"&gt;{&lt;/SPAN&gt; &lt;SPAN class="xuc5kci"&gt;return&lt;/SPAN&gt; &lt;SPAN class="xu88d7e"&gt;IsRound &lt;SPAN class="x1noocy9"&gt;?&lt;/SPAN&gt;&lt;/SPAN&gt; roundProfileTypeNames &lt;SPAN class="x1noocy9"&gt;:&lt;/SPAN&gt; rectProfileTypeNames&lt;SPAN class="x1noocy9"&gt;;&lt;/SPAN&gt; &lt;SPAN class="x1noocy9"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="x1noocy9"&gt;}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="x1yztbdb"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel xt4736n x1havqas x1f0sm9e xrg5i2u xzsf02u x1yc453h xudqn12 x3x7a5m"&gt;Then, in your XAML, bind the &lt;CODE&gt;ItemsSource&lt;/CODE&gt; of the &lt;CODE&gt;DataGridComboBoxColumn&lt;/CODE&gt; to this new property:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x10394xv xmymobo x1lfhtmy x9puuxd x1a2cdl4 xnhgr82 x1qt0ttw xgk8upj x13fuv20 xu3j5b3 x1q0q8m5 x26u7qi x178xt8z xm81vs4 xso031l xy80clv x11ujt6w x6ikm8r x10wlt62 x889kno x1iji9kk x1a8lsjc x1sln4lm x2bj2ny x1yztbdb"&gt;
&lt;DIV class="x1n2onr6 x1ja2u2z x9f619 x78zum5 xdt5ytf x2lah0s x193iq5w"&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x1iyjqo2 x2lwn1j"&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x2lah0s x193iq5w x14l7nz5 xyorhqc"&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 x1r8uery x1iyjqo2 xs83m0k xeuugli x1qughib x6s0dn4 xozqiw3 x1q0g3np xcud41i x139jcc6"&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x193iq5w xeuugli x1r8uery x1iyjqo2 xs83m0k x150jy0e x1e558r4 xl56j7k x1hshjfz"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel x1qo61fq x81x36d xa4e6wy x31b0c2 xi81zsa x1yc453h xudqn12 x3x7a5m"&gt;&lt;SPAN class="x1lliihq x193iq5w x6ikm8r x10wlt62 xlyipyv xuxw1ft"&gt;Xaml&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x2lah0s x193iq5w xeuugli x150jy0e x1e558r4"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="x9f619 x1n2onr6 x1ja2u2z x78zum5 xdt5ytf x193iq5w x1l7klhg x1iyjqo2 xs83m0k x2lwn1j xzboxd6 x14l7nz5"&gt;
&lt;PRE class="x1mqxbix xjup8qr x9f619 x1mocir3 x1ov8dlk xrv4cvt xdpxx8g x1sdyfia xp3md9m x1lldw8n xp5j34i x1evy7pa x1k5ss6i xuix1fa xwp6svo x1v60uq5 x159lptv x11uu2j1 xw2csxc x1odjw0f x1lq5wgf xgqcy7u x30kzoy x9jhf4c xdj266r x11i5rnm xat24cr x1mh8g0r"&gt;&lt;CODE class="xjup8qr xl0teqc xab0eaz x6d3u8q x1un5nx7"&gt;&amp;lt;DataGridComboBoxColumn Width="100" Header="Profile Type" x:Name="ProfileType" 
    SelectedValueBinding="{Binding ProfileType, Mode=TwoWay}"  
    ItemsSource="{Binding ProfileTypeList}" 
    DisplayMemberPath="{Binding ProfileType}" /&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="x1yztbdb"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel xt4736n x1havqas x1f0sm9e xrg5i2u xzsf02u x1yc453h xudqn12 x3x7a5m"&gt;This way, when the &lt;CODE&gt;IsRound&lt;/CODE&gt; property changes, the &lt;CODE&gt;ProfileTypeList&lt;/CODE&gt; property will return the correct list, and the &lt;CODE&gt;DataGridComboBoxColumn&lt;/CODE&gt; will update its items accordingly.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x1e56ztr"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel xt4736n x1havqas x1f0sm9e xrg5i2u xzsf02u x1yc453h xudqn12 x3x7a5m"&gt;Note that I assume &lt;CODE&gt;roundProfileTypeNames&lt;/CODE&gt; and &lt;CODE&gt;rectProfileTypeNames&lt;/CODE&gt; are already defined and populated in your code. If not, you'll need to make sure they are properly initialized and accessible.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x1e56ztr"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel xt4736n x1havqas x1f0sm9e xrg5i2u xzsf02u x1yc453h xudqn12 x3x7a5m"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x1e56ztr"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel xt4736n x1havqas x1f0sm9e xrg5i2u xzsf02u x1yc453h xudqn12 x3x7a5m"&gt;Does that help?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="x1e56ztr"&gt;&lt;SPAN class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x xlh3980 xvmahel xt4736n x1havqas x1f0sm9e xrg5i2u xzsf02u x1yc453h xudqn12 x3x7a5m"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 21 Apr 2024 08:13:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/binding-different-lists-to-different-rows-in-datagrid/m-p/12722989#M5797</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2024-04-21T08:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Binding different lists to different rows in DataGrid</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/binding-different-lists-to-different-rows-in-datagrid/m-p/12723125#M5798</link>
      <description>&lt;P&gt;I did the same, here is how my ProfileItem class looks like (there are many rows below of initializing the 2 lists):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class ProfileItem
{
    public string ProfileName { get; set; }
    public bool IsRound { get; set; }
    public string ProfileType { get; set; }
    public Element ProfileElement { get; set; }

    public List&amp;lt;string&amp;gt; ProfileTypeList
    {
        get { return IsRound ? roundProfileTypeNames : rectProfileTypeNames; }
    }


    public List&amp;lt;string&amp;gt; rectProfileTypeNames = new List&amp;lt;string&amp;gt;();
    public List&amp;lt;string&amp;gt; roundProfileTypeNames = new List&amp;lt;string&amp;gt;();

    public ProfileItem(string name, Element elem)
    {

        this.ProfileName = name;
        this.ProfileElement = elem;
        rectProfileTypeNames.Add("RHS 50x30 / 2.6");
        rectProfileTypeNames.Add("RHS 50x30 / 3.2");
        rectProfileTypeNames.Add("RHS 50x30 / 4");
        rectProfileTypeNames.Add("RHS 50x30 / 5");
   ...
   ...
   }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also add ItemsSource="{Binding ProfileTypeList}" to my xaml file:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;DataGrid Name="profilePropsGrid" Width="500" CanUserReorderColumns="False" HorizontalAlignment="Center" CanUserAddRows="False" VerticalAlignment="Top" AutoGenerateColumns="False"&amp;gt;
    &amp;lt;DataGrid.Columns&amp;gt;
        &amp;lt;DataGridTextColumn Header="Profile Name" Width="*" Binding="{Binding ProfileName}" IsReadOnly="true" /&amp;gt;
        &amp;lt;DataGridTemplateColumn Header="Is Rounded Profile?" Width="*" &amp;gt;
            &amp;lt;DataGridTemplateColumn.CellTemplate&amp;gt;
                &amp;lt;DataTemplate&amp;gt;
                    &amp;lt;CheckBox IsChecked="{Binding Path=IsRound}" Checked="IsRoundChecked" Unchecked="IsRoundUnchecked" /&amp;gt;
                &amp;lt;/DataTemplate&amp;gt;
            &amp;lt;/DataGridTemplateColumn.CellTemplate&amp;gt;
        &amp;lt;/DataGridTemplateColumn&amp;gt;
        &amp;lt;DataGridComboBoxColumn Width="100" Header="Profile Type" x:Name="ProfileType" 
             SelectedValueBinding="{Binding Path=ProfileType}"  
             ItemsSource="{Binding ProfileTypeList}"
            DisplayMemberPath="{Binding ProfileType}" /&amp;gt;
    &amp;lt;/DataGrid.Columns&amp;gt;
&amp;lt;/DataGrid&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now my ProfileType column shows me empty lists in all DataGrid rows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrahi_amir_0-1713696060984.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1352623i3E325532D229B694/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrahi_amir_0-1713696060984.png" alt="mizrahi_amir_0-1713696060984.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can see in my ProfileItem class that ProfileTypeList shows "0 references":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrahi_amir_1-1713696121269.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1352624iD91D63CE5BB0495C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrahi_amir_1-1713696121269.png" alt="mizrahi_amir_1-1713696121269.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the binding doesn't take place. Isn't it?&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 10:43:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/binding-different-lists-to-different-rows-in-datagrid/m-p/12723125#M5798</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-04-21T10:43:41Z</dc:date>
    </item>
  </channel>
</rss>

