Hello all,

How can I get the selected item value for a datagrid?

Best regards,

Re: DataGrid selected item value by Peter

Peter
Sat Dec 08 04:33:21 PST 2007

The CurrentCell property gives you the row and column numbers, then use the
indexer to retrieve the specific value:-

object value = dataGrid1[dataGrid1.CurrentCell.RowNumber,
dataGrid1.CurrentCell.ColumnNumber];

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

"Miguel" <miguel_at_gdl@yahoo.com> wrote in message
news:%23Z0YTgPOIHA.484@TK2MSFTNGP06.phx.gbl...
> Hello all,
>
> How can I get the selected item value for a datagrid?
>
> Best regards,
>


Re: DataGrid selected item value by Miguel

Miguel
Sat Dec 08 11:54:08 PST 2007

Excellent!

Than you Peter.

Miguel.

"Peter Foot" <feedback@nospam-inthehand.com> escribió en el mensaje
news:eHdYFaZOIHA.3816@TK2MSFTNGP04.phx.gbl...
> The CurrentCell property gives you the row and column numbers, then use
> the indexer to retrieve the specific value:-
>
> object value = dataGrid1[dataGrid1.CurrentCell.RowNumber,
> dataGrid1.CurrentCell.ColumnNumber];
>
> Peter
>
> --
> Peter Foot
> Microsoft Device Application Development MVP
> www.peterfoot.net | www.inthehand.com
> In The Hand Ltd - .NET Solutions for Mobility
>
> "Miguel" <miguel_at_gdl@yahoo.com> wrote in message
> news:%23Z0YTgPOIHA.484@TK2MSFTNGP06.phx.gbl...
>> Hello all,
>>
>> How can I get the selected item value for a datagrid?
>>
>> Best regards,
>>
>