Datagrid data validity

i have connected datagrid with adodc control and allowupdate property is true. My data fields contain 1 date field .i like to make validation for that.
when i am updating data in grid suppose i updated /entered date field prior to 3 days or tomarrows date for perticular record it should show invalid data message and that date field for perticular record should clear.it should accept today' date,yesterday's date and day before yestreday's date.

I don't want to put validity at database lavel.it shuld be done in frontend(vb)

please help me urgently
Ganesh :)

Comments

  • : i have connected datagrid with adodc control and allowupdate property is true. My data fields contain 1 date field .i like to make validation for that.
    : when i am updating data in grid suppose i updated /entered date field prior to 3 days or tomarrows date for perticular record it should show invalid data message and that date field for perticular record should clear.it should accept today' date,yesterday's date and day before yestreday's date.
    :
    : I don't want to put validity at database lavel.it shuld be done in frontend(vb)
    :
    : please help me urgently
    : Ganesh :)
    :
    There are a few events that you can use with a datagrid. You may wish to investigate these

    BeforeUpdate
    BeforeInsert
    Change
    Validate

    You can build your validation routines using these events. You can cancel an update (write to the database) if required to ensure that the correct data is written.

    Hope this helps

    John ;-)

  • Dear john,
    my problem is i don't know anything about this.suppose my date column no is 6.when user type data in perticular cell how to track it.i tried using .celltext, . value ,.cellvalue , .text but it doen't work.i will be thankful if you provide me sample code.
    By the way can we use combobox in datagrid.if you know that please explain me and if possible give me sample code.

    Please it's very urgent
    Ganesh :)

  • : Dear john,
    : my problem is i don't know anything about this.suppose my date column no is 6.when user type data in perticular cell how to track it.i tried using .celltext, . value ,.cellvalue , .text but it doen't work.i will be thankful if you provide me sample code.
    : By the way can we use combobox in datagrid.if you know that please explain me and if possible give me sample code.
    :
    : Please it's very urgent
    : Ganesh :)
    :
    :
    Ganesh

    The Datagrid control has limitations. Its simple but not very flexible. I have seen examples of overlaying controls such as combobox over the cells so it appears that the datagrid has drop down lists. I have also seen examples of overlaying textboxes to handle data validation prior to the transfer to the datagrid itself.

    Here is some sample code on how to use a value from a datagrid in a validation situation.

    Private Sub DataGrid1_BeforeUpdate (Cancel As Integer)
    If DataGrid1.Columns(1).Value = "" Then
    MsgBox "You must enter a value"
    Cancel = True
    End If
    End Sub

    Here is a link to a Ms doc on placing a datalist under a datagrid
    http://support.microsoft.com/default.aspx?scid=kb;en-us;235944

    This may help you a little more. Let me know if you need more.

    John ;-)
  • Dear john,
    thanks i just find out using combobox in datagrid and that resolved my problem.
    i tried using beforecolupdate,beforeupdate same way but it doesn't work way i wanted.if you find some stuf please let me know
    Ganesh :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories