We help IT Professionals succeed at work.

Error: 'Row' is not a member of 'System.EventArgs'

deanlee17
deanlee17 used Ask the Experts™
on
Hi experts,

I have a flexgrid with the code below which fires when a new row is added to the grid. I also want this code assigned to a button, button if i actually copy the code i get the above error. How can I get this to fire on a button click?

-------------------------------------------------

 Private Sub FlxHeader_AfterAddRow(sender As System.Object, e As C1.Win.C1FlexGrid.RowColEventArgs) Handles FlxHeader.AfterAddRow


        Dim str = Environment.UserName.ToUpper()
        Dim tokens = str.Split("."c)
        Dim initials = String.Format("{0}{1}", tokens(0)(0), tokens(1)(0))


        'Current Date without seperators
        Dim rightNow As DateTime = DateTime.Now
        Dim strCurrentDateTimeString As String
        strCurrentDateTimeString = rightNow.ToString("yyyyMMddHH")

        'Populate flxgridheader with Astute Ref
        FlxHeader.Select(FlxHeader.Rows.Count - 1, 1)
        FlxHeader(e.Row, 9) = initials + strCurrentDateTimeString

        FlxHeader(e.Row, 2) = Me.txtCustomer.Value

        WriteToDB()

    End Sub

-------------------------------------

Thanks,
Dean.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014

Commented:
Why do you want to do that? One option is to call a method which would add a new row and then this code will be called automatically. I am not sure what that method (to add new row) is for flexgrid.
Commented:
Change e.Row to
CType(sender, FlxHeader).CurrentCell.ColumnIndex

Open in new window