Results 1 to 2 of 2

Thread: Adding a row to the datagrid but not the DataSet

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    treehouse
    Posts
    106

    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.

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    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
  •  



Click Here to Expand Forum to Full Width