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
  1. Home
  2. General Programming
  3. C#
  4. Assignment Problem

Assignment Problem

Scheduled Pinned Locked Moved C#
databasehelpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eyalle
    wrote on last edited by
    #1

    Hello all my problem is that for some reason, a simple assignment isn't working. the dataGridView is binded to DB and im trying to assign a value type string to a column of type string

    //the initialization of the DataGridView
    bindingSourceSchema.DataSource = null;
    dgwSchema.Columns["colID"].DataPropertyName = "APP_ID";
    dgwSchema.Columns["colName"].DataPropertyName = "DESCRIPTION";
    dgwSchema.Columns["colTextbox"].DataPropertyName = "APP_ARGS";
    dgwSchema.Columns["colTextbox"].HeaderText = "Parameters";
    dgwSchema.Columns["colLink"].DataPropertyName = "APP_PATH";
    dgwSchema.Columns["colLink"].HeaderText = "Path";

            DataGridViewLinkColumn colLink = (DataGridViewLinkColumn)dgwSchema.Columns\["colLink"\];
            colLink.UseColumnTextForLinkValue = true;
            colLink.Text = "Edit";
            bindingSourceSchema.DataSource = SchemaDB.GetGenericApps();
    

    .
    .
    .

    //the assignment
    if (openFileDialog.ShowDialog() == DialogResult.OK)
    {
    dgwSchema.CurrentRow.Cells["colLink"].Value = openFileDialog.FileName;

                    // !! ?? dgwSchema.CurrentRow.Cells\["colLink"\].Value STAYS with parameter "Edit"
                }
    

    Thanks Eyal

    E 1 Reply Last reply
    0
    • E eyalle

      Hello all my problem is that for some reason, a simple assignment isn't working. the dataGridView is binded to DB and im trying to assign a value type string to a column of type string

      //the initialization of the DataGridView
      bindingSourceSchema.DataSource = null;
      dgwSchema.Columns["colID"].DataPropertyName = "APP_ID";
      dgwSchema.Columns["colName"].DataPropertyName = "DESCRIPTION";
      dgwSchema.Columns["colTextbox"].DataPropertyName = "APP_ARGS";
      dgwSchema.Columns["colTextbox"].HeaderText = "Parameters";
      dgwSchema.Columns["colLink"].DataPropertyName = "APP_PATH";
      dgwSchema.Columns["colLink"].HeaderText = "Path";

              DataGridViewLinkColumn colLink = (DataGridViewLinkColumn)dgwSchema.Columns\["colLink"\];
              colLink.UseColumnTextForLinkValue = true;
              colLink.Text = "Edit";
              bindingSourceSchema.DataSource = SchemaDB.GetGenericApps();
      

      .
      .
      .

      //the assignment
      if (openFileDialog.ShowDialog() == DialogResult.OK)
      {
      dgwSchema.CurrentRow.Cells["colLink"].Value = openFileDialog.FileName;

                      // !! ?? dgwSchema.CurrentRow.Cells\["colLink"\].Value STAYS with parameter "Edit"
                  }
      

      Thanks Eyal

      E Offline
      E Offline
      eyalle
      wrote on last edited by
      #2

      The reason is following property is set to true. colLink.UseColumnTextForLinkValue = true; Set it to false. Then it will resolve your problem.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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