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
K

kanchoette

@kanchoette
About
Posts
119
Topics
63
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reference combobox used on another form?
    K kanchoette

    Many thanks for that. I shall proceed accordingly. :thumbsup:

    C# question

  • Reference combobox used on another form?
    K kanchoette

    I need to reference a combobox value (selectedvalue) on another form to the current form. How can I do this please? I tried setting the combobox modifier to 'Public' and while in NewForm using MainForm.myComboBox.selectedValue without success.

    C# question

  • Regex question
    K kanchoette

    I hace some code which starts: if (textBox1.Text.Length > 0) { String pat = "*.csv"; Regex r = new Regex (pat, RegexOptions.IgnoreCase); Match m = r.Match(textBox1.Text); if (m.Success) { GetCSV(textBox1.Text); } which is giving me the error: "parsing "*.csv" - Quantifier {x,y} following nothing." What am I doing wrong please?

    C# regex question json help

  • Setting DataGridView ColumnHeader text
    K kanchoette

    Beaucoup de mercis de votre aide. Beaucoup a apprécié.

    C# question csharp linq graphics

  • Setting DataGridView ColumnHeader text
    K kanchoette

    I am using the following code to import a csv file into a datagridview: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace CSVImporter { public partial class Form1 : Form { public Form1() { InitializeComponent(); List<string[]> csv = parseCSV("C:\\text.csv"); DataTable newTable = new DataTable(); string[] headers = csv[0]; int counter = 0; foreach (string column in headers) { DataColumn colNewDGCol = new DataColumn(); colNewDGCol.ColumnName = "CSV" + headers[counter]; newTable.Columns.Add(colNewDGCol); newTable.Columns[counter].HeaderText = headers[counter]; counter++; } foreach (string[] row in csv) { newTable.Rows.Add(row); } dataGridView1.DataSource = newTable; } public List<string[]> parseCSV(string path) { List<string[]> parsedData = new List<string[]>(); using (StreamReader readFile = new StreamReader(path)) { string line; string[] row; while ((line = readFile.ReadLine()) != null) { row = line.Split(','); parsedData.Add(row); } } return parsedData; } } } But the line: newTable.Columns[counter].HeaderText = headers[counter]; does not work. How can I create the appropriate column header text please?

    C# question csharp linq graphics

  • Casting error question
    K kanchoette

    Many thanks for your reply. Sill me realised that I needed SelectedValue instead of selectedItem to do the job. The perils of late night coding .......

    C# help tutorial question

  • Casting error question
    K kanchoette

    I am using: foreach (DebtorDataSet.PaymentArrangementsRow row in debtorDataSet.PaymentArrangements.Rows) { if (row.PaymentArrangementID != -1 && row.PaymentTypeID == Convert.ToInt32(paymentCategoryComboBox.SelectedItem) && row.ArrangementComplete == false) { row.ArrangementComplete = true; row.ArrangementDate = DateTime.Today; } } but this is giving me the error: 'Unable to cast object of type 'System.Data.DataRowView' to type 'System.IConvertible'' I am not sure how to correct this. Any help would be much appreciated please.

    C# help tutorial question

  • Ascertain table bound to textBox
    K kanchoette

    No hacking. No excitement here :) My application contains several texboxes which are databound to table(s) containing date fields. The users have a habit of putting dates into the wrong textboxes (Grrrr!!) and then trying to correct the error(s) by attempting to have a blank (null) textbox via the backspace key. The system won't allow this. So, I am trying to create a function which a) understands which textbox it is checking b) locates the correct table databound to that textbox (my question) c) sets the associated table row field to System.DBNull.Value in order for my application to be satisfied with the user's correction. Hope that makes more sense. My apologies for the curt original question. I always assume that all coders are part of the Borg collective :) He he.

    C# question

  • Ascertain table bound to textBox
    K kanchoette

    How can I find which table is bound to a textBox please?

    C# question

  • Find MIN value in binding?
    K kanchoette

    If I want to locate the minimum value for a column in a datatable I would use something like:

    int minArrangementID = (int) debtorDataSet.PaymentArrangements.Compute("MIN(PaymentArrangementID)", "PaymentArrangementID > 0");

    How can I find the minimum value within a binding please?

    C# question wpf wcf

  • Read row value from previous DataRowView
    K kanchoette

    If I want to grab a DataRowView I use: DataRowView arrangement = (DataRowView)BindingContext[debtorDataSet, "Debtor.FK_PaymentArrangements_Debtor"].Current; How can I get a DataRowView for the previous position without changing the position to do so please?

    C# question

  • DBNull error
    K kanchoette

    Although I have all datatable columns set to accept DBNull, my application throws this exception:

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public System.DateTime ArrangementDate {
    get {
    try {
    return ((global::System.DateTime)(this[this.tablePaymentArrangements.ArrangementDateColumn]));
    }
    catch (global::System.InvalidCastException e) {
    throw new global::System.Data.StrongTypingException("The value for column \'ArrangementDate\' in table \'PaymentArrangements\' is DBNull.", e);
    }
    }
    set {
    this[this.tablePaymentArrangements.ArrangementDateColumn] = value;
    }
    }

    I'm stumped (right now). Any pointers would be much appreciated please.

    C# help

  • DataBinding removal error
    K kanchoette

    The project has changed and the data binding for the textbox is no longer required.

    C# visual-studio help question

  • DataBinding removal error
    K kanchoette

    I have a textBox databound to a datatable via the properties window. It works well. I now need to remove this databinding. When doing this, via the properties window, and setting the Text section of DataBindings back to 'None' I get this error when re-running the solution: 'object reference not set to an instance of an object' for line: firstPaymentDateTextBox.DataBindings["Text"].Format += new ConvertEventHandler(DebtConvert.DateToString); it seems that VS 2008 does not remove this line when resetting the databinding via the designer properties window. It there a way around this please? As I have a lot of databindings to remove it seems a little tedious for such a, otherwise, powerful IDE.

    C# visual-studio help question

  • Form_Load event problem
    K kanchoette

    Many thanks for your reply. I had my load subscription within

    private void InitializeComponent()
    {

    }

    C# debugging help

  • Form_Load event problem
    K kanchoette

    Within my Form I am using

    this.Load += new System.EventHandler(this.ItemForm_Load);

    private void ItemForm_Load(object sender, EventArgs e)
    {
    myDataSet.Merge(mainForm.newDataSet);
    }

    However, the merge does not take place. Placing a breakpoint in the debugger shows that the ItemForm_Load never gets hit. Any pointers would be much appreciated.

    C# debugging help

  • ListView Context Menu
    K kanchoette

    Many thanks for the heads up. Much appreciated.

    C# question visual-studio

  • ListView Context Menu
    K kanchoette

    I am using MS VS 2008 and can find the ListView property ContextMenuStrip, but no property for ContextMenu. How can I activate (show) a ContextMenu when I right-click my ListView please?

    C# question visual-studio

  • How to open multiple pdf files
    K kanchoette

    Is there a way to open multiple pdf files, via c# please?

    C# csharp tutorial question

  • ListView not populatng
    K kanchoette

    Sorry, but I don't understand your reply. I'm using a) Create new listViewItem b) add subitems to listViewItem c) Add listViewItem to listview model. Which I use successfully elsewhere in my project. I am not sure what your 'item.Text = "MyTitle";' pertains to.

    C# csharp linq graphics sales
  • Login

  • Don't have an account? Register

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