title: WPF binding errors
body: <p>I am new to WPF and this binding error is making me crazy. 
  I have a datatemplate which has combobox. That datatemplate is used by gridview column. I am trying to bind the combobox to csla object but it is throwing me below error:</p>
  
  <blockquote>
    <p>System.Windows.Data Error: 40 : BindingExpression path error:<br>
    'oChargeCodesValidvalues' property not found on 'object'
    ''EditGridCellData' (HashCode=59067897)'.
    BindingExpression:Path=DataContext.oChargeCodesValidvalues;
    DataItem='ComboBox' (Name=''); target element is 'ComboBox' (Name='');
    target property is 'ItemsSource' (type 'IEnumerable')</p>
  </blockquote>
  
  <p>here is the snippet of my xaml: </p>
  
  <pre><code>&lt;DataTemplate x:Key="combodescriptionTemplate"&gt;
      &lt;ComboBox Name="cboCodeValidValues" ItemsSource="{Binding DataContext.oChargeCodesValidvalues, RelativeSource={RelativeSource Mode=Self}}"&gt;
          &lt;ComboBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;TextBlock Text="{Binding Description}" /&gt;
              &lt;/DataTemplate&gt;
          &lt;/ComboBox.ItemTemplate&gt;
      &lt;/ComboBox&gt;
  &lt;/DataTemplate&gt;
  &lt;local:TotalCellTemplateSelector x:Key="totalcellTemplateSelector"                                                             
                                   combodescriptionTemplate="{StaticResource combodescriptionTemplate}"/&gt;
  </code></pre>
  
  <p>Some more info based on the comments:
  I am using a devexpress gridview in wcf. There are 2 columns both bounded to field. First is combobox and second is textbox by default and combo based on value of first column.The gridview datasource is code csla object. ChargeCodeValidValues is cslaobjcet . And i used datatemplate to change editor of second column.</p>
  
  <p>Below is the code snippet of my ChargeCodeValidValues object:</p>
  
  <pre><code>public class ChargeCodeValidValues
  {
  
  
      public DataTable ChargeCodesValidValuesTable { get; set; }
  
  
  
  
      public ChargeCodeValidValues()
      {
          LoadChargeCodesValidValues();
      }
  
      public void LoadChargeCodesValidValues()
      {
          //get data from db
      }
  </code></pre>
  
  <p>calling in code:</p>
  
  <pre><code> private ChargeCodeValidValues oChargeCodesValidvalues;
     oChargeCodesValidvalues = new ChargeCodeValidValues(); 
  </code></pre>
  
  <p>and i am trying to bind combox to oChargeCodesValidvalues and getting above error.</p>
  
  <p>Here is the snippet of my TotalCellTemplateSelector:</p>
  
  <pre><code> public DataTemplate combodescriptionTemplate { get; set; }
      public override DataTemplate SelectTemplate(object item, DependencyObject container)
      {
          GridCellData cellData = item as GridCellData;    
  
  
          if (cellData != null)
          {
  
              RowData rowdata = cellData.RowData;
  
              DataRowView rowview = rowdata.Row as DataRowView;
              if (rowview != null)
              {
                  DataRow drCC = rowview.Row;
                  //if(drCC.Field&lt;int&gt;("FieldName") != DBNull.Value)
                  //{
                  int Code = drCC.Field&lt;int&gt;("FieldName", 0);
                  if (Code == Value)
                      return combodescriptionTemplate;
                  else
  
                      return null;
                  // }
              }
  </code></pre>