473,503 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid - add row (null) question ?

As we add a new row in datagrid, How can we make it not display (null) in
that blank new record ??
I search some newsgroup talk about .allownull = false.
But I am fail to use it , Any idea ?

Thanks
Nov 20 '05 #1
4 1845
I dont know if this is possible or not, however, it is displaying the
correct representation of its value, so why would you want to change that ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
As we add a new row in datagrid, How can we make it not display (null) in
that blank new record ??
I search some newsgroup talk about .allownull = false.
But I am fail to use it , Any idea ?

Thanks

Nov 20 '05 #2
Agnes,

I do not know if you like it, however you can fill all the rows when they
are created with a default column value. That means that blanks are then as
well blanks in the database and zeroes are zeroes in the database. When that
is what you want you can have a look at.

Datacolumn.defaultvalue
http://msdn.microsoft.com/library/de...valuetopic.asp

I hope this helps?

Cor
Nov 20 '05 #3
Thanks Cor,
So, During my form load, I will load the data in the datagrid programically
with a special datagridtablestyles ,
If I want to addrow without null value, That's mean I need to create another
new datagridtablestyles ?

Before I am using vfp as development tools, its datagrid won't show null
value as new row. I am afraid the end-user dislike and challenge and new
design of .net system.

"Cor Ligthert" <no**********@planet.nl> ¦b¶l¥ó
news:Of*************@TK2MSFTNGP11.phx.gbl ¤¤¼¶¼g...
Agnes,

I do not know if you like it, however you can fill all the rows when they
are created with a default column value. That means that blanks are then as well blanks in the database and zeroes are zeroes in the database. When that is what you want you can have a look at.

Datacolumn.defaultvalue
http://msdn.microsoft.com/library/de...valuetopic.asp
I hope this helps?

Cor

Nov 20 '05 #4
Hi Agnes,

I gave you in my previous answer the answer when you want to be lazy and do
not want to make columns, this is much nicer of course with columns.

I hope this helps?

Cor

Private Sub Form7_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim dt As New DataTable("Agnes")
dt.Columns.Add("Cor")
For i As Integer = 0 To 4
Dim dr As DataRow = dt.NewRow
dr(0) = (i + 1).ToString
dt.Rows.Add(dr)
Next
Dim dv As New DataView(dt)
Me.DataGrid1.DataSource = dv
Dim ts As New DataGridTableStyle
ts.MappingName = "Agnes"
ts.GridColumnStyles.Add(New DataGridTextBoxColumn)
ts.GridColumnStyles.Item(0).MappingName = "Cor"
ts.GridColumnStyles.Item(0).HeaderText = "Ident"
ts.GridColumnStyles.Item(0).NullText = String.Empty
DataGrid1.TableStyles.Add(ts)
End Sub
///
Nov 20 '05 #5

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

Similar topics

2
3238
by: Tamlin | last post by:
Hi all, I'm getting a bug with the datagrid object. I've created one from scratch, bound it to a dataview with 2 int32 columns and formatted the output as currency. I've found that when you...
2
2703
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
3
4236
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
3
6061
by: Zürcher See | last post by:
Someone has implemented a Datagrid Button for the Windows.Form?
3
3016
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
2
4315
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
0
3531
by: Mauro | last post by:
Hi, I need a big help to resolve this problem. I need to put a usercontrol in a datagrid: this control check if the code inserted is present in a archive and if not return a error message. (In...
2
1597
by: ddaniel | last post by:
I have read many posts and seen many papers on the different techniques for sort and filtering datagrids. Many do re-queries against the dB ala Fritz Onion. I am trying to leverage the Dataview....
5
1151
by: tshad | last post by:
I want to use a datagrid with my display, but I don't want to use 1 row per record. What I have is a record with up to 6 values - (answer1,answer2,answer3,answer4,answer5,answer6). I want to...
7
3189
by: julian.tklim | last post by:
Hi, I need to build an editable Datagrid with add & delete buttons on each row using javascript. DataGrid need not be pre-populated with values. To make the thing complicated, one of the...
0
7093
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...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7467
tracyyun
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...
0
5592
agi2029
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,...
1
5021
isladogs
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...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
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...

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.