Click here to Skip to main content
13,836,677 members

Silverlight / WPF

 
GeneralRe: Ad Control / monetization Pin
Super Lloyd19-Dec-18 16:40
memberSuper Lloyd19-Dec-18 16:40 
AnswerRe: Ad Control / monetization Pin
Gerry Schmitz23-Dec-18 10:02
mveGerry Schmitz23-Dec-18 10:02 
GeneralRe: Ad Control / monetization Pin
Super Lloyd23-Dec-18 10:39
memberSuper Lloyd23-Dec-18 10:39 
GeneralRe: Ad Control / monetization Pin
Gerry Schmitz28-Dec-18 10:39
mveGerry Schmitz28-Dec-18 10:39 
QuestionValidation in WPF Pin
Kevin Marois18-Dec-18 7:59
professionalKevin Marois18-Dec-18 7:59 
AnswerRe: Validation in WPF Pin
Super Lloyd18-Dec-18 14:09
memberSuper Lloyd18-Dec-18 14:09 
AnswerRe: Validation in WPF Pin
Gerry Schmitz23-Dec-18 9:57
mveGerry Schmitz23-Dec-18 9:57 
QuestionI dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Rabee3-F1.78754516-Dec-18 3:01
memberRabee3-F1.78754516-Dec-18 3:01 
<DataGrid Grid.Column="1" x:Name="GrdInsCardsLookup" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MaxWidth="600" Margin="3,6,3,-1" Background="{x:Null}">
                <DataGrid.BorderBrush>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="Black" Offset="0"/>
                        <GradientStop Color="#FFE22020" Offset="1"/>
                    </LinearGradientBrush>
                </DataGrid.BorderBrush>

                <DataGrid.Columns>

                    <DataGridTextColumn Header="ID"  Width="130"  Binding="{Binding NationalId}"/>
                    <DataGridTextColumn Header="Name"  Width="140" Binding="{Binding Name}"/>
                    <DataGridTextColumn Header="Phone" Width="120" Binding="{Binding Phone}"/>
                    <DataGridTextColumn Header="City" Width="100" Binding="{Binding City}"/>

                </DataGrid.Columns>

            </DataGrid>


public class Instructer
  {
      public int Id { set; get; }
      public string NationalId { set; get; }
      public string Name { set; get; }
      public string Fname { set; get; }
      public string Lname { set; get; }
      public string FatherName { set; get; }
      public int Cityid { set; get; }
      public string City { set; get; }
      public string Address { set; get; }
      public string Email { set; get; }
      public string Phone { set; get; }
      public string Mobile { set; get; }
      public DateTime Birthday { set; get; }
      public string Picid { set; get; }
      public string Folder { set; get; }
  }


public DataSet AllInsDataSet = new DataSet();
public List<Instructer> InstructersByName = new List<Instructer>();



  private void FillInsList() //2-Step Get Instructers List with there cities names from SQl Server
       {
           AllInsDataSet.Clear();
           var con1 = new SqlConnection(Connectionstring);
           SqlCommand cmd1;
           cmd1 =
               new SqlCommand(
                   "SELECT S1.[ins_id],S1.[ins_national_id],S1.[fname] as FName,S1.[father_name] as 'FatherName',S1.[lname] as 'LName',S1.[city_id],C1.[city],S1.[address],S1.[email],S1.[phone],S1.[mobile],S1.[birthday],S1.[pic_id],S1.[folder_id],S1.[other] FROM [DB_SchoolManager].[dbo].[tbl_ins_cards] S1 Inner Join [DB_SchoolManager].[dbo].[tbl_cities] C1 on S1.city_id=C1.city_id",
                   con1);
           SqlDataAdapter da1;
           da1 = new SqlDataAdapter(cmd1);
           da1.Fill(AllInsDataSet);
       }

private void FillLookupInsGrdByName(string name)
       {
           InstructersByName.Clear();
           GrdStuCardsLookup.ItemsSource = InstructersByName;
           string upname = name.ToUpper();

           for (int i = 0; i < AllInsDataSet.Tables[0].Rows.Count; i++)
           {
               if (((AllInsDataSet.Tables[0].Rows[i][2] + " " + AllInsDataSet.Tables[0].Rows[i][3] + " " + AllInsDataSet.Tables[0].Rows[i][4]).ToUpper()).Contains(upname))
               {
                   InstructersByName.Add(new Instructer()
                   {
                       Id = int.Parse(AllInsDataSet.Tables[0].Rows[i][0].ToString()),
                       NationalId = AllInsDataSet.Tables[0].Rows[i][1].ToString(),
                       Name = AllInsDataSet.Tables[0].Rows[i][2] + " " + AllInsDataSet.Tables[0].Rows[i][3] + " " + AllInsDataSet.Tables[0].Rows[i][4],
                       City = AllInsDataSet.Tables[0].Rows[i][6].ToString(),
                       Phone = AllInsDataSet.Tables[0].Rows[i][9].ToString(),
                       Picid = AllInsDataSet.Tables[0].Rows[i][12].ToString(),
                       Folder = AllInsDataSet.Tables[0].Rows[i][13].ToString()
                   });
               }
           }

           GrdInsCardsLookup.ItemsSource = InstructersByName;


       }
       private void TxtSrchInsName_TextChanged(object sender, TextChangedEventArgs e)
       {
           if (!String.IsNullOrEmpty(TxtSrchInsName.Text))
           {
               SrchName = TxtSrchInsName.Text;
               FillLookupInsGrdByName(SrchName);
           }
       }

AnswerRe: I dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Super Lloyd16-Dec-18 16:50
memberSuper Lloyd16-Dec-18 16:50 
GeneralRe: I dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Rabee3-F1.78754517-Dec-18 11:22
memberRabee3-F1.78754517-Dec-18 11:22 
GeneralRe: I dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Super Lloyd17-Dec-18 16:28
memberSuper Lloyd17-Dec-18 16:28 
AnswerRe: I dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Richard Deeming17-Dec-18 10:20
mveRichard Deeming17-Dec-18 10:20 
QuestionI dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Rabee3-F1.78754516-Dec-18 2:34
memberRabee3-F1.78754516-Dec-18 2:34 
QuestionReorder Elements in ScrollViewer/Grid Pin
GenJerDan12-Dec-18 10:38
memberGenJerDan12-Dec-18 10:38 
AnswerRe: Reorder Elements in ScrollViewer/Grid Pin
Super Lloyd12-Dec-18 19:11
memberSuper Lloyd12-Dec-18 19:11 
GeneralRe: Reorder Elements in ScrollViewer/Grid Pin
GenJerDan12-Dec-18 20:27
memberGenJerDan12-Dec-18 20:27 
QuestionBorder With Bound Pulsating Color Pin
Kevin Marois10-Dec-18 6:53
professionalKevin Marois10-Dec-18 6:53 
AnswerRe: Border With Bound Pulsating Color Pin
Super Lloyd12-Dec-18 18:06
memberSuper Lloyd12-Dec-18 18:06 
QuestionBinding To Single List Item Pin
Kevin Marois27-Nov-18 11:23
professionalKevin Marois27-Nov-18 11:23 
AnswerRe: Binding To Single List Item Pin
Meshack Musundi27-Nov-18 21:17
professionalMeshack Musundi27-Nov-18 21:17 
GeneralRe: Binding To Single List Item Pin
Pete O'Hanlon27-Nov-18 22:03
protectorPete O'Hanlon27-Nov-18 22:03 
GeneralRe: Binding To Single List Item Pin
Meshack Musundi27-Nov-18 22:12
professionalMeshack Musundi27-Nov-18 22:12 
GeneralRe: Binding To Single List Item Pin
Pete O'Hanlon27-Nov-18 23:19
protectorPete O'Hanlon27-Nov-18 23:19 
GeneralRe: Binding To Single List Item Pin
Meshack Musundi27-Nov-18 22:24
professionalMeshack Musundi27-Nov-18 22:24 
GeneralRe: Binding To Single List Item Pin
Pete O'Hanlon27-Nov-18 23:18
protectorPete O'Hanlon27-Nov-18 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190114.1 | Last Updated 17 Jan 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid