Windows Forms Datagrid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bernard

    #1

    Windows Forms Datagrid

    HI,

    I have a Datagrid with some columns,... anyone knows how
    can I retrieve the values of the selected row?

    Thanks,
  • Dmitriy Lapshin [C# / .NET MVP]

    #2
    Re: Windows Forms Datagrid

    Hi Bernard,

    Look at the code snippet below:

    CurrencyManager cm = (CurrencyManage r)this.BindingC ontext[
    dataGrid.DataSo urce,
    dataGrid.DataMe mber];
    DataView view = (DataView)cm.Li st;

    string customerName = view[cm.Position]["CustomerNa me"]

    --
    Dmitriy Lapshin [C# / .NET MVP]
    X-Unity Test Studio

    Bring the power of unit testing to VS .NET IDE

    "Bernard" <bernardoantoni o.piano@eds.com > wrote in message
    news:0b0501c3c4 31$ce3bc110$a00 1280a@phx.gbl.. .[color=blue]
    > HI,
    >
    > I have a Datagrid with some columns,... anyone knows how
    > can I retrieve the values of the selected row?
    >
    > Thanks,[/color]

    Comment

    Working...