PC Review


Reply
Thread Tools Rate Thread

DataGrid delete rows nightmare

 
 
New Member
Join Date: Aug 2010
Posts: 2
 
      4th Aug 2010
Hi there,

I thought I had a simple issue and the further I investigate the trickier it gets. What I use:
VB2005 and Windows Mobile 5.0
I want to make a program with a kind of DataGrid which show the barcodes I've read and the amounts entered by keyboard.
I thought I create a DataTable to store the data and present it in a DataGrid (by binding it) on the screen. No problem so far. Now I like to add a delete button aswell. No problem there...... well in fact there is. Once you delete a row with a command like
Code:
    x = DataGrid.Item(DataGrid.CurrentRowIndex, 0)
    TableScan.Rows.RemoveAt(x)
I found out that resulting DataGrid doesn't represent the underlying DataTable as the indexes are ****ed up. And this is not an official MS bug, it is by design.....
A solution would be (I read on the Net) to use DataGridView, but this is not supported in CF2.0 which uses Windows Mobile 5.0
Is there any solution for this?

Thanks in advance,

Albert
 
Reply With Quote
 
 
 
 
New Member
Join Date: Aug 2010
Posts: 2
 
      5th Aug 2010
Hi there,

I've solved the problem after logging the underlying DataTable. I don't need DataGridView. The thing I did wrong was this code:
Code:
 x = DataGrid.Item(DataGrid.CurrentRowIndex, 0)
it should have been
Code:
 x = DataGrid.CurrentRowIndex
Otherwise I used the value of the first column of the selected row instead of the index value of the selected row.

Now I only need to find a methode that the first row automatically contains the index value of the DataTable and not the value in the first Column.
 
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
Delete Rows From DataGrid rn5a@rediffmail.com Microsoft ASP .NET 0 4th Dec 2006 07:18 AM
delete rows from datagrid Sam Microsoft VB .NET 10 4th Apr 2005 10:51 AM
How to Delete rows from a sorted DataGrid =?Utf-8?B?REJX?= Microsoft C# .NET 0 12th Nov 2004 07:13 PM
Delete mutiple rows in a dataGrid using delete Key =?Utf-8?B?TVZC?= Microsoft Dot NET Framework 0 26th Oct 2004 04:39 AM
Delete rows from DataGrid not working? =?Utf-8?B?Sm9iIExvdA==?= Microsoft Dot NET 0 30th Jul 2004 03:19 AM


Features
 

Advertising
 

Newsgroups
 


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