Using VB.NET: I am populating a DataTable from a SQL Server table, then
associating that DataTable to a DataGrid control. I want to disallow the
user from inserting new records on that DataGrid, but I cannot find a way to
do this. Is there a way to prevent a user from inserting a new row through
the DataGrid - either
in the DataGrid itself, or in the original DataTable I am creating?
- Thanks,
JRD 2 2068
John,
Your only possibility in that is
dataview(defaul tview).allownew = false
(When you than want to add a row in code using the dataview you have to set
it temporaly to true)
Although the code in C# is exactly the same. Did you know that there is a
newsgroup
microsoft.publi c.dotnet.langua ges.vb
and as well
microsoft.publi c.framework.ado net
However I hope that the answer on your qeustion helps?
Cor
"John R. Dougherty" Using VB.NET: I am populating a DataTable from a SQL Server table, then associating that DataTable to a DataGrid control. I want to disallow the user from inserting new records on that DataGrid, but I cannot find a way
to do this. Is there a way to prevent a user from inserting a new row
through the DataGrid - either in the DataGrid itself, or in the original DataTable I am creating?
- Thanks,
JRD
What about if you wanted to have the new rows show up on the top of the
datagrid instead of the bottom?
"Cor Ligthert" wrote: John,
Your only possibility in that is dataview(defaul tview).allownew = false
(When you than want to add a row in code using the dataview you have to set it temporaly to true)
Although the code in C# is exactly the same. Did you know that there is a newsgroup microsoft.publi c.dotnet.langua ges.vb and as well microsoft.publi c.framework.ado net
However I hope that the answer on your qeustion helps?
Cor
"John R. Dougherty" Using VB.NET: I am populating a DataTable from a SQL Server table, then associating that DataTable to a DataGrid control. I want to disallow the user from inserting new records on that DataGrid, but I cannot find a way to do this. Is there a way to prevent a user from inserting a new row through the DataGrid - either in the DataGrid itself, or in the original DataTable I am creating?
- Thanks,
JRD This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Sue |
last post by:
On code-behind page:
(attributes set programatically for each of these elements)
linkbutton added to tablecell
textbox added to tablecell
tablecells added to tablerow
tablerow added to table (table.ID is TestTable)
On .aspx page:
<HeaderTemplate>
<asp:Table ID="TestTable" runat="Server" />
</HeaderTemplate>
|
by: Jim Heavey |
last post by:
Trying to figure out the technique which should be used
to add rows to a datagrid. I am thinking that I would
want an "Add" button on the footer, but I am not quite
sure how to do that. Is that the best method? Do you
have a sample of how to do this?
|
by: Chip |
last post by:
I'm using Andy Smith's RowSelectorColumn control (great control) and I'm not
sure if this question is generic to all datagrid controls or this particular
one.
Is there a way to disable one of the checkboxes based on data in the grid?
If so, can you provide the syntax?
Thanks,
Chip
|
by: suresh |
last post by:
frenz,
i need to disable the add new record mode in datarid.
i just want to modify the existing records in the
grid...but i dont want to add new records..how do i do
that?
-suresh
|
by: Tor Inge Rislaa |
last post by:
Prevent Adding new records in DataGrid
Hi I have a DataGrid that I want to open for editing but the user should not
be able to add new records. When I set the ReadOnly = False it is possible
to edit but it is also able to add new records. How do I prevent that?
| |
by: John R. Dougherty |
last post by:
Using VB.NET: I am populating a DataTable from a SQL Server table, then
associating that DataTable to a DataGrid control. I want to disallow the
user from inserting new records on that DataGrid, but I cannot find a way to
do this. Is there a way to prevent a user from inserting a new row through
the DataGrid - either
in the DataGrid itself, or in the original DataTable I am creating?
- Thanks,
JRD
|
by: simchajoy2000 |
last post by:
I thought the only thing I had to do to disable column sorting in
VB.NET was to set datagrid.AllowSorting = False. Unfortunately this
has never worked for me. I discovered another set of code that seems
to work for 99% of the cases where I need to disable datagrid column
sorting:
Private Sub datagrid_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles datagrid.MouseDown
Dim pt As New Point(e.X,...
|
by: glenn |
last post by:
Hi folks,
I have a DropDownList in a DataGrid that is populated from records in a
database.
I want to add a value that might be a string such as "Select a Company" for
the first item since an OnSelectedIndex event is not fired if you select the
first item.
Does anyone know of an easy way to do this?
|
by: ECD |
last post by:
Hello all,
I can usually find solutions to my .NET problems by searching these
groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0
framework). I want to disable sorting on the first column in the grid
only. I havent found a way to reliably do this yet.
I tried putting the following code in the datagrid's mouse down event
Dim hti As DataGrid.HitTestInfo
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |