Hi All,<BR><BR>I am trying to Make a component which will make the datagrid programmatically. So I have created a class myDataGrid.vb and in that I am instantiating and creating a DataGrid.<BR><BR>Dim myDataGrid As New DataGrid()<BR>Dim DeleteColumn As New ButtonColumn()<BR>Dim EditColumn As New EditCommandColumn()<BR><BR>With myDataGrid<BR>.BackColor = System.Drawing.Color.White<BR>.HeaderStyle.Font.Si ze = System.Web.UI.WebControls.FontUnit.XSmall<BR>.Head erStyle.Font.Bold = True<BR>.BorderStyle = BorderStyle.Solid<BR>.ShowFooter = False<BR>.CellPadding = "1"<BR>End With<BR><BR>With DeleteColumn<BR>.ButtonType = ButtonColumnType.LinkButton<BR>.Text = "Delete"<BR>End With<BR>myDataGrid.Columns.Add(DeleteColumn)<BR><B R>With EditColumn<BR>.ButtonType = ButtonColumnType.LinkButton<BR>.UpdateText = "Post"<BR>.CancelText = "Cancel"<BR>.EditText = "Edit"<BR>End With<BR>myDataGrid.Columns.Add(EditColumn)<BR><BR> Now I have a Procedure which will execute delete:<BR><BR>Sub DeleteLine(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)<BR> &#039;Delete statements<BR>End Sub<BR><BR>My problem is How to add to tell the program to go and execute DeleteLine procedure when the user will click on Delete linkButton on the Grid ????<BR><BR>I tried <BR>AddHandler myDataGrid.DeleteCommand, AddressOf Me.DeleteLine<BR>this doesn&#039;t work<BR><BR>I have worked with datagrid and I used datagrid.ondeleteCommand property to specify the procedure to be executed. But when I use the .vb class, ondeleteCommand property is not displayed.<BR><BR>I want to execute the procedure DeleteLine and EditLine depending on whether the user clicks on Delete LinkBUtton or Edit LinkButton.<BR><BR>Please reply,<BR>Thanks a million,<BR>Rishi Chaturvedi<BR><BR>