PC Review


Reply
Thread Tools Rate Thread

Change value cell after click on row in DataGridView

 
 
PawelR
Guest
Posts: n/a
 
      8th May 2007
Hi Group,
In my application I have DataTable which is displayed in DataGridView via
DataView:

DataView myView = new DataView(myTable);
myDataGridView.DataSource = myView;

One column im myTable is boolean (two state - without null value). How can I
change value in this column after click on row in datagridview (one of cells
in rows).
Before sorting this is no problem, but after sort data by user (click in
header of column) row index in datagridview and row index in dataview (and
table) are diferent.

Thx for help

Pawel


 
Reply With Quote
 
 
 
 
bob
Guest
Posts: n/a
 
      11th May 2007

From memory( a very shaky source :0)
the DataGridView CurrentRow property can be indexed into to get to a
particular cell.
Something like
DataGridViewRow r = this.dgv1.CurrentRow;
r[2] = true;
hth
Bob


On Tue, 8 May 2007 11:04:45 +0200, "PawelR" <(E-Mail Removed)>
wrote:

>Hi Group,
>In my application I have DataTable which is displayed in DataGridView via
>DataView:
>
>DataView myView = new DataView(myTable);
>myDataGridView.DataSource = myView;
>
>One column im myTable is boolean (two state - without null value). How can I
>change value in this column after click on row in datagridview (one of cells
>in rows).
>Before sorting this is no problem, but after sort data by user (click in
>header of column) row index in datagridview and row index in dataview (and
>table) are diferent.
>
>Thx for help
>
>Pawel
>

 
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
DataGridView does not save last change even I CommitEdit; But if I click somewhere else, it saves! Ryan Liu Microsoft C# .NET 0 25th Mar 2008 12:38 PM
Help need with cell click on DataGridView and C# 2005? =?Utf-8?B?U2FyYXZhbmFu?= Microsoft Dot NET Framework Forms 1 8th Feb 2007 09:09 AM
DatagridView cell - how to make it more responsive to mouse click Bill nguyen Microsoft VB .NET 0 30th Jun 2006 02:53 PM
Right-click in DataGridView to Select Cell DaveS Microsoft Dot NET Framework Forms 1 3rd Mar 2006 06:40 PM
.NET 2.0: Right click on DataGridView and Cell Selection A.M-SG Microsoft Dot NET Framework Forms 1 17th Jan 2006 06:12 AM


Features
 

Advertising
 

Newsgroups
 


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