PC Review


Reply
Thread Tools Rate Thread

Datagrid Row

 
 
David Fúnez
Guest
Posts: n/a
 
      6th May 2005
Hi;

I have a Form with a DataGrid, i can click in a cell and that data is shown
in a textbox, but what i need is to get all the data from that row to
display it in Textboxes.

by now i just can display 1 cell, ¿how can i display the other cells from
that row?

Thanks on advance.

--
David Fúnez
Tegucigalpa, Honduras



 
Reply With Quote
 
 
 
 
chris-s@mailcity.com
Guest
Posts: n/a
 
      6th May 2005
Several choices..

1) add a load of controls and 'databind' them to the relevant column in
the dataset

2) use a databound control to access the 'key' value, if there is one,
and then use a separate select & datareader to retrieve the row

or

public System.Data.DataRow SelectedRow(DataGrid dataGrid)
{
if(dataGrid != null)
{
try
{
System.Windows.Forms.BindingManagerBase bm =
dataGrid.BindingContext[dataGrid.DataSource];

return ((System.Data.DataRowView) bm.Current).Row;
}
catch
{
return null;
}
}
else
return null;
}

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MVVM: Single datagrid row selection when a datagrid contains anotherdatagrid in side RowDetailsTemplate Sunita@.NET Microsoft C# .NET 0 12th Nov 2010 09:03 AM
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event. Daniel Roth Microsoft Dot NET Framework 0 5th Apr 2005 04:54 AM
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls thegame Microsoft ASP .NET 1 28th Feb 2005 04:23 PM
Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False Amar Microsoft ASP .NET 0 6th Apr 2004 11:14 AM
DataGrid Component | Displaying columns of a DataSet as Rows in a DataGrid ? Diego TERCERO Microsoft C# .NET 3 19th Dec 2003 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:07 AM.