Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
HTML
<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
Updated 13-Oct-11 14:37pm
v3

1 solution

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900