473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to supress deleting a Row

Hello

I have a DataGrid that a is bound to a DataTable. Some of the rows in the
DataTable should not be deleted. How can I prohibit deleting of some
identified rows?

The problem could be specified in the following format too:

There is a DataView object that I want to prohibit deleting of some of its
DataRowView objects. that is: when drv.Delete() is called (drv is the
identified DataRowView) it doesn't delete the DataRowView object (suppress
that the Deleted tag is assigned to the RowState) . How can I do this job?
Regards
Hamed
Aug 14 '06 #1
6 1327
Datagridview
AllowUserToDeleteRows {true or false}

Datagrid
set the allow delete of the dataview that is bound to it to false

dim dt as datatable
dim dv as dataview
dim dbg as datagrid

'Get the default view from the table
dv = dt.defaultview

'Disallow deleted
dv.allowdelete = false

'Set the datasource
dbg.datasource = dv

"Hamed" <ha***@raymehr.comwrote in message
news:eB**************@TK2MSFTNGP05.phx.gbl...
Hello

I have a DataGrid that a is bound to a DataTable. Some of the rows in the
DataTable should not be deleted. How can I prohibit deleting of some
identified rows?

The problem could be specified in the following format too:

There is a DataView object that I want to prohibit deleting of some of its
DataRowView objects. that is: when drv.Delete() is called (drv is the
identified DataRowView) it doesn't delete the DataRowView object (suppress
that the Deleted tag is assigned to the RowState) . How can I do this job?
Regards
Hamed

Aug 14 '06 #2
This technique disallows delete of whole grid. I want to prohibit delete of
some identified rows. for example I know that I should disallow deletion of
second row but others may be deleted.

Any help or comment is appreciated.

Hamed

"AMDRIT" <am****@hotmail.comwrote in message
news:er****************@TK2MSFTNGP04.phx.gbl...
Datagridview
AllowUserToDeleteRows {true or false}

Datagrid
set the allow delete of the dataview that is bound to it to false

dim dt as datatable
dim dv as dataview
dim dbg as datagrid

'Get the default view from the table
dv = dt.defaultview

'Disallow deleted
dv.allowdelete = false

'Set the datasource
dbg.datasource = dv

"Hamed" <ha***@raymehr.comwrote in message
news:eB**************@TK2MSFTNGP05.phx.gbl...
>Hello

I have a DataGrid that a is bound to a DataTable. Some of the rows in the
DataTable should not be deleted. How can I prohibit deleting of some
identified rows?

The problem could be specified in the following format too:

There is a DataView object that I want to prohibit deleting of some of
its DataRowView objects. that is: when drv.Delete() is called (drv is the
identified DataRowView) it doesn't delete the DataRowView object
(suppress that the Deleted tag is assigned to the RowState) . How can I
do this job?
Regards
Hamed


Aug 14 '06 #3
Hamid,

The check which row it is do you have to do of course yourself, but that
should be for every developer a piece of cake.

http://www.vb-tips.com/dbpages.aspx?...9-57ec163eaa17

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:eB**************@TK2MSFTNGP05.phx.gbl...
Hello

I have a DataGrid that a is bound to a DataTable. Some of the rows in the
DataTable should not be deleted. How can I prohibit deleting of some
identified rows?

The problem could be specified in the following format too:

There is a DataView object that I want to prohibit deleting of some of its
DataRowView objects. that is: when drv.Delete() is called (drv is the
identified DataRowView) it doesn't delete the DataRowView object (suppress
that the Deleted tag is assigned to the RowState) . How can I do this job?
Regards
Hamed

Aug 14 '06 #4
Thanks Cor. I checked it. It seems it can solve my problem.

Regards
Hamed
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:e3******************@TK2MSFTNGP04.phx.gbl...
Hamid,

The check which row it is do you have to do of course yourself, but that
should be for every developer a piece of cake.

http://www.vb-tips.com/dbpages.aspx?...9-57ec163eaa17

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:eB**************@TK2MSFTNGP05.phx.gbl...
>Hello

I have a DataGrid that a is bound to a DataTable. Some of the rows in the
DataTable should not be deleted. How can I prohibit deleting of some
identified rows?

The problem could be specified in the following format too:

There is a DataView object that I want to prohibit deleting of some of
its DataRowView objects. that is: when drv.Delete() is called (drv is the
identified DataRowView) it doesn't delete the DataRowView object
(suppress that the Deleted tag is assigned to the RowState) . How can I
do this job?
Regards
Hamed


Aug 15 '06 #5
Thanks Cor. I checked it. It seems it can solve my problem.

Regards
Hamed
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:e3******************@TK2MSFTNGP04.phx.gbl...
Hamid,

The check which row it is do you have to do of course yourself, but that
should be for every developer a piece of cake.

http://www.vb-tips.com/dbpages.aspx?...9-57ec163eaa17

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:eB**************@TK2MSFTNGP05.phx.gbl...
>Hello

I have a DataGrid that a is bound to a DataTable. Some of the rows in the
DataTable should not be deleted. How can I prohibit deleting of some
identified rows?

The problem could be specified in the following format too:

There is a DataView object that I want to prohibit deleting of some of
its DataRowView objects. that is: when drv.Delete() is called (drv is the
identified DataRowView) it doesn't delete the DataRowView object
(suppress that the Deleted tag is assigned to the RowState) . How can I
do this job?
Regards
Hamed


Aug 15 '06 #6
Thanks Cor. I am going to check it.

It seems it can solve my problem.

Regards
Hamed
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:e3******************@TK2MSFTNGP04.phx.gbl...
Hamid,

The check which row it is do you have to do of course yourself, but that
should be for every developer a piece of cake.

http://www.vb-tips.com/dbpages.aspx?...9-57ec163eaa17

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:eB**************@TK2MSFTNGP05.phx.gbl...
>Hello

I have a DataGrid that a is bound to a DataTable. Some of the rows in the
DataTable should not be deleted. How can I prohibit deleting of some
identified rows?

The problem could be specified in the following format too:

There is a DataView object that I want to prohibit deleting of some of
its DataRowView objects. that is: when drv.Delete() is called (drv is the
identified DataRowView) it doesn't delete the DataRowView object
(suppress that the Deleted tag is assigned to the RowState) . How can I
do this job?
Regards
Hamed



Aug 15 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: LRW | last post by:
I'm creating a simple reply form, and if a form item isn't answered I get an error: "Notice: Undefined index: rb_amntspent in c:\inetpub\wwwroot\mackinaw\survey.php on line 36" even if in the...
1
by: roderik | last post by:
How do I supress the output generated from each psycopg command: >>> import psycopg initpsycopg: initializing psycopg 1.99.10 typecast_init: initializing NUMBER .. .. microprotocols_add:...
1
by: David | last post by:
I have a custom control that contains a class that Inherits the panel control. I am trying to catch a keydown event in this class and then supress it from the rest of the control as well as the...
3
by: JG | last post by:
Hi all, I have a simple aspx page. On the page there is only one button. When I click on the button, the event sequence is Page_Load, Button1_click and Page_PreRender. How do I supress the...
2
by: Still Learning | last post by:
Hi, Currently a crystal report is getting 359.9999 from a dataset. Even with rounding set to 0.0001 it displays 360.0 which is wrong. How can I supress rounding or get it to display 359.9999? ...
4
by: rob c | last post by:
This is a minor thing and only appears in IE (so far), but I'd like to know to correct it (if possible). Whenever I use a form on a webpage, Explorer always leaves a blank line following the...
9
by: Hamed | last post by:
Hello I have a DataGrid that a is bound to a DataTable. Some of the rows in the DataTable should not be deleted. How can I prohibit deleting of some identified rows? The problem could be...
1
by: Nikhil Mittal | last post by:
How to supress system errors in windows perl In unix it is 2>&1 , what is in windows :o
2
by: =?Utf-8?B?Q2hyaXMgRGF2b2xp?= | last post by:
I have to zero supress some numbers ie; 20.000000000 or 20.0100000 What is an easy way to do this? If I got to write code, is there some code examples out there? -- Chris Davoli
2
by: khani | last post by:
Hi i have following situation in cystal report in detail section i have a field say name.now i have five duplication record like this zahid zahid zahid zahid
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.