Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

MemberDotNetting

@MemberDotNetting
About
Posts
78
Topics
38
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • parser csv
    M MemberDotNetting

    thank you, tried it, but i can't debug solution when i add

    CsvReaderViewModel vm = new CsvReaderViewModel("my source");
    DataContext = vm;

    near InitializeComponent();

    WPF csharp css wpf

  • parser csv
    M MemberDotNetting

    Hi, i tried this code to parse CSV file and save data in a wpf data grid, the code is correct but i can't store values on datagrid this is a class wich contain the code: public class CsvParser { public List ReadAndParseData(string path, char separator) { var parseData = new List(); using (var sr = new StreamReader(path)) { string line; while ((line = sr.ReadLine()) != null) { string[] row = line.Split(separator); parseData.Add(row); } } return parseData; } } } the is the code behind; assigned to event click on boutton List parseData = csv.ReadAndParseData(datasource, ';'); foreach (string[] row in parseData) { MessageBox.Show(""+row.GetValue(0));// i get the correct value dgvreceipient.Items.Add(row.....);// but i get a empty datagrid }

    WPF csharp css wpf

  • can't cnnect with EDM
    M MemberDotNetting

    Hi, i'm developping a wpf application and i use an EDM to generate DATABASE, i have the EDM in a separate class library, and i have added a refernce to my main project and i have added also an app.config in may main project wich contain the connetionstring their. but I am getting the following error when attempting to connect to the EDM: "The specified named connection is either not found in the configuration, not intended to be used with the EntityClient Provider, not valid." can i add the connection string in app.xaml??

    .NET (Core and Framework) wpf csharp database help question

  • passing data betwen tabitem and datagrid
    M MemberDotNetting

    I am a student and I'm doing my final year project and this project is the first work with WPF, I downloaded a book and I make every effort to learn because I believe in that "le difficile c'est le chemin" and I asked a lot of questions because I have a month to develop my application also it is not MVVM because company demanded another architecture...thank you

    WPF csharp dotnet wpf

  • passing data betwen tabitem and datagrid
    M MemberDotNetting

    Hi, i have 2 tabitem, each one cotain a wpf gdatagrid i want to pass data from grid1 in tabitem1 to grid2 in tabintem2 when i click on tab item2 or on boutton. i tried this code but i get exception: L'élément possède déjà un parent logique. Il doit être détaché de l'ancien parent avant d'être attaché au nouveau.

    private void btnValidate_Click(object sender, RoutedEventArgs e)
    {
    for (int j = 0; j < i - 1; j++)
    {
    TextBlock x = dgrecep.Columns[0].GetCellContent(dgrecep.Items[j]) as TextBlock;// GRID1 TABITEM1
    if (x != null)
    {
    if (v.validate(x.Text))
    {

                       dgrecep2.Items.Add(dgrecep.Columns\[0\].GetCellContent(dgrecep.Items\[j\]));//GRID2 TABITEM2
                    }
                    else
                    {
                        MessageBox.Show("non valide");
                    }
    
    WPF csharp dotnet wpf

  • bind data from dattable with datagrid
    M MemberDotNetting

    i tried to bind data from datatable to wpf datagrid with code behind

    Binding b = new Binding();
    ExcelParser exc = new ExcelParser();
    DataTable dt = exc.GetDataTableExcel(datasource);
    b.Source = dt.DefaultView;
    b.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
    b.Path = new PropertyPath("F1");
    this.dgvreceipient.SetBinding(TextBlock.TextProperty, b);

    when i use xamlcode it work:

    but i need to have this on code behind.

    WPF wpf csharp wcf

  • try to add data on wpf DataGridColumn
    M MemberDotNetting

    thnk you, please I tried to use interface: this is the code but it doesn't work

    public interface Iimportdata
    {
    DataView GridData { get; set; }
    }

    //traitement2--Excel
    private DataView Data = null;
    public DataView GridData
    {
    get
    { return Data;
    }
    set
    {
    Data = value;
    NotifyPropertyChanged("GridData");
    }
    }

    public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    

    private void btnExcel_Click(object sender, RoutedEventArgs e)
    {

            ExcelParser exc = new ExcelParser();
            DataTable dt = exc.GetDataTableExcel(datasource);
          
            Iimportdata imp = Window.GetWindow(this) as Iimportdata;
            imp.GridData = dt.DefaultView;
            gbReceipient.Visibility = Visibility.Visible;
            btnValidate.Visibility = Visibility.Visible;
        }
    

    XAML:

    :(

    WPF wpf csharp help

  • try to add data on wpf DataGridColumn
    M MemberDotNetting

    Hi, I try to import data from an Excel file and display it in a datagrid, the data are email addresses. i want that data will be shown on

    but when i click on boutton, another DataGridColumn appears with data, but i want that data shown on DataGridColumn="Adress" code of parse:

    public class ExcelParser
    {
    public DataTable GetDataTableExcel(string datasource)
    {

            OleDbConnection theConnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + datasource + ";Extended Properties=\\"Excel 8.0;HDR=NO;IMEX=1;\\"");
            theConnection.Open();
    
            OleDbDataAdapter theDataAdapter = new OleDbDataAdapter("SELECT \* FROM \[Feuil1$\]", theConnection);
    
            DataTable dt = new DataTable();
    
            theDataAdapter.Fill(dt);
    
            return dt;
        }
    

    xaml:

    boutton click excel code behined:

    private void btnExcel_Click(object sender, RoutedEventArgs e)
    {

            wpfOpenfiledialog o = new wpfOpenfiledialog();
            o.openfich(1);
            datasource = o.filename;
    
            ExcelParser exc = new ExcelParser();// class to get data from excel files
            DataTable dt = exc.GetDataTableExcel(datasource);
            //dgvreceipient.ItemsSource = dt.DefaultView;=========>the problem that this ligne will show another column 
          
            
        }
    
    WPF wpf csharp help

  • wpf ritchbox
    M MemberDotNetting

    i try to change the size of text in ritchbox with code behind

    TextRange tr = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
    tr.ApplyPropertyValue(FontSizeProperty, (double)9);

    but i want to change

    tr.ApplyPropertyValue(FontSizeProperty, (double)9)

    by

    double size=Convert.ToDouble(comboboxfontsize.selectedItem)// or selected value;
    tr.ApplyPropertyValue(FontSizeProperty, size)

    i get an exception Impossible d'effectuer un cast d'un objet de type 'System.Windows.Controls.ComboBoxItem' en type 'System.IConvertible'. so how can i get the value selected item?

    WPF question csharp wpf

  • add wpf user control
    M MemberDotNetting

    Hi, i have a wpf user control wich allow me to show print window . how can i show wpf user control when i click on button in another window??

    WPF question csharp wpf

  • user control
    M MemberDotNetting

    I create a library of these classes contains a user control that contains images as background to some button, I add it to the main page such as referance, I added this code to retrieve the control xaml user

    but i get an exception: the user control Cannot locate resource :^)

    WPF wpf learning

  • can't found provider sqlserver
    M MemberDotNetting

    yes i can connect from mangemenet studio and i configured it

    C# database csharp sql-server sysadmin

  • can't found provider sqlserver
    M MemberDotNetting

    Hi, i use Visual C# express 2010 to develop my application. I installed sql server 2008, I tried to generate the database from EDM and when I want to connect to sql server I can't find the provider of Microsoft Sql Server

    C# database csharp sql-server sysadmin

  • how can i get cell value from wpf datagrid?
    M MemberDotNetting

    how can i get cell value from wpf datagrid? this code, wich used to validate data (email adress) from datagrid private void button2_Click(object sender, RoutedEventArgs e) { Validator v =new Validator();// class... String item = dgv1.CurrentCell.Item.ToString(); if (v.validate(item)) { MessageBox.Show("ok"); } else { MessageBox.Show("no"); } }

    WPF question csharp wpf

  • Reference: Object reference not set to an instance of an object.
    M MemberDotNetting

    i Stick a breakpoint on the line combdb.ItemsSource = ConnexionSqlServer.GetDataBasesNames() wich is the method that fill the combobox, i get the exception on combobox although the method returns the names of the database when I test every single button while it works but the problem is when I migrate from one button to another

    C# database mysql sql-server sysadmin

  • Reference: Object reference not set to an instance of an object.
    M MemberDotNetting

    i Stick a breakpoint on the line combdb.ItemsSource = ConnexionSqlServer.GetDataBasesNames() wich is the method that fill the combobox, i get the exception on combobox although the method returns the names of the database when I test every single button while it works but the problem is when I migrate from one button to another

    C# database mysql sql-server sysadmin

  • Reference: Object reference not set to an instance of an object.
    M MemberDotNetting

    I stick a breakpoint on the line that's raising the exception, and i get combobox item=null

    C# database mysql sql-server sysadmin

  • Reference: Object reference not set to an instance of an object.
    M MemberDotNetting

    combdb.SelectedItem=null

    C# database mysql sql-server sysadmin

  • Reference: Object reference not set to an instance of an object.
    M MemberDotNetting

    the connexionmysql is a static class witch contain the connection with database with the method"getconnexion" and function "getdatabasenames"

    C# database mysql sql-server sysadmin

  • Reference: Object reference not set to an instance of an object.
    M MemberDotNetting

    yes i created mysql connexion in a class //if (ConnexionMysql.getConnexion(datasource))

    C# database mysql sql-server sysadmin
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups