Ejemplo n.º 1
0
        private static void OnTekstPropChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataGridRaf u = d as DataGridRaf;

            if (u.TekstProp != null)
            {
                if (u.TekstProp.Length >= 3)
                {
                    u.podmiotListView = u.podmiotList.Where(r => r.nazwa.Contains(u.TekstProp) == true).ToList();
                }
            }
        }
Ejemplo n.º 2
0
        private static void OnSelectedValue(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataGridRaf u = d as DataGridRaf;
            int         result;

            if (u.selectedValueRaf != null)
            {
                if (Convert.IsDBNull(u.selectedValueRaf))
                {
                    u.selectedItemRaf = null;
                    u.TekstProp       = string.Empty;
                }
                else
                {
                    int.TryParse(u.selectedValueRaf.ToString().ToString(), out result);

                    if (result == 0)
                    {
                        u.selectedItemRaf = null;
                        u.TekstProp       = string.Empty;
                    }
                    else
                    {
                        //u.selectedItemRaf = u.dataGridSource.DefaultView.Cast<DataRowView>().Where(r => r["ID"].ToString() == result.ToString()).FirstOrDefault();

                        u.selectedItemRaf = u.podmiotListView.Where(r => r.id == result).FirstOrDefault();

                        if (u.selectedItemRaf == null)
                        {
                            u.TekstProp = string.Empty;
                        }
                        else
                        {
                            u.TekstProp = u.selectedItemRaf.nazwa;
                        }
                    }
                }
            }
        }