|
-
Jul 7th, 2003, 11:50 AM
#1
Thread Starter
Lively Member
Adding a row to the datagrid but not the DataSet
Does anyone know how to add a row to the datagrid control.
I am binding a dataset to the datagrid and I want the user to click an "Add" button to add a new row in the grid but I do not want to add it to the dataset until the user fills out all non-null fields.
I am not able to add it to the dataset because of the schema and it does not allow nullable values in some of the fields.
-
Jul 7th, 2003, 04:42 PM
#2
Hyperactive Member
The row is not added to the dataset until you update, if you have a probl;em with Null values, then craeate a data grid tablestyle and use the columnstyle function to handle null text.
an example below:
Dim tbs1 As New DataGridTableStyle()
tbs1.MappingName = "Your data set"
Dim l3 As New DataGridTextBoxColumn()
l3.MappingName = "Name"
l3.HeaderText = " Name"
l3.Width = 135
l3.NullText = ""
tbs1.GridColumnStyles.Add(l3)
DataGrid1.TableStyles.Add(tbs1)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|