Results 1 to 3 of 3

Thread: [RESOLVED] help with (datagridviewcell)

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Resolved [RESOLVED] help with (datagridviewcell)

    Im down to my last few conversions for my project

    im trying to rename a cell in a datagridview to "un" if it meets certian critera

    the "problem im running into is the line


    userdgv["department", index] = "UN";
    gives
    Cannot implicitly convert type 'string' to System.Windows.Forms.DataGridViewCell'

    okay so no big deal so i tried

    userdgv["department", index] = (DataGridViewCell)"UN";
    and got
    Cannot convert type 'string' to 'System.Windows.Forms.DataGridViewCell'

    some not sure how to convert it if i cant do it manualy or implicitly

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: help with (datagridviewcell)

    The DataGridView indexer (Item property in VB) is a DataGridViewCell reference. The Value property of a DataGridViewCell is a reference to the data it contains:
    Code:
    userdgv["department", index].Value = "UN";
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Re: help with (datagridviewcell)

    doh

    I guess i was looking at the wrong side of that situation

    ill give it a try tonight

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width