Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.5 DataGrid
hi Every
one i has WPF DataGrid and it has Column Called Code it is a datagridtemplateColumn , i put ComboBox in this Column but i try to fill the comboBox IemsSource and i could not reach to the Combo Box From Code (This.Cmx_Code.ItemsSource is Not Allowed ) so how can i fill the itemsSource of the Combo Box
<datagridtemplatecolumn loc:translate.uid="1658" header="Code" width="*" xmlns:x="#unknown" xmlns:loc="#unknown">
                    <datagridtemplatecolumn.celltemplate>
                        <datatemplate>
                            <combobox x:name="Cmx_Code" selectionchanged="Cmx_Kind_SelectionChanged" itemssource="{Binding}">
                                <combobox.displaymemberpath>Code</combobox.displaymemberpath>
                                <combobox.selectedvaluepath>Med_ID</combobox.selectedvaluepath>
                                <combobox.selectedvalue>
                                    <binding>
                                        <binding.path>Med_ID</binding.path>
                                        <binding.mode>TwoWay</binding.mode>
                                        <binding.updatesourcetrigger>PropertyChanged</binding.updatesourcetrigger>
                                    </binding>
                                </combobox.selectedvalue>
                            </combobox>
                        </datatemplate>
                    </datagridtemplatecolumn.celltemplate>                    
                </datagridtemplatecolumn>
Posted 13-Oct-11 12:14pm
Edited 13-Oct-11 15:37pm
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

try using DataBinder.Eval() function http://msdn.microsoft.com/en-us/library/4hx47hfe.aspx[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 300
2 Sergey Alexandrovich Kryukov 289
3 CPallini 235
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 5 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100