Hello, can anyone offer any advice, this one is driving me
up the wall!
1. I am using a webform datagrid.
2. The columns are all dynamic and defined using templates
(see code below).
3. I have a nice set of buttons on the grid for edit,
update, cancel and delete.
4. I handle the events with the "Handles
dgGrid.EditComm and", "Handles dgGrid.UpdateCo mmand",
and "Handles dgGrid.CancelCo mmand" options (again see the
code below).
The problem is that edit and delete work perfectly but I
can not get the cancel and update commands to fire. All
they do is cause a postback. Any suggestions?
Code from webform1.aspx (headers only)
--------------------------------------------------------
Sub dgGrid_Edit(ByV al sender As Object, ByVal e As
DataGridCommand EventArgs) Handles dgGrid.EditComm and
Sub dgGrid_Cancel(B yVal sender As Object, ByVal e As
DataGridCommand EventArgs) Handles dgGrid.CancelCo mmand
Sub dgGrid_Delete(B yVal sender As Object, ByVal e As
DataGridCommand EventArgs) Handles dgGrid.DeleteCo mmand
Sub dgGrid_Update(B yVal sender As Object, ByVal e As
DataGridCommand EventArgs) Handles dgGrid.UpdateCo mmand
Code from templates
-------------------------------------------------------
Case ListItemType.It em
Dim ctl As New LinkButton
ctl.ID = "lnkbutEdit "
ctl.Width = Unit.Pixel(16)
ctl.Text = "<img border=0
src=images/im_edit.gif alt=edit>"
ctl.CommandName = "Edit"
ctl.CausesValid ation = False
container.Contr ols.Add(ctl)
Case ListItemType.Ed itItem
'Save
Dim ctl1 As New LinkButton
ctl1.ID = "lnkbutUpda te"
ctl1.Width = Unit.Pixel(16)
ctl1.Text = "<img border=0
src=images/im_update.gif alt=update>"
ctl1.CommandNam e = "Update"
ctl1.CausesVali dation = True
container.Contr ols.Add(ctl1)
up the wall!
1. I am using a webform datagrid.
2. The columns are all dynamic and defined using templates
(see code below).
3. I have a nice set of buttons on the grid for edit,
update, cancel and delete.
4. I handle the events with the "Handles
dgGrid.EditComm and", "Handles dgGrid.UpdateCo mmand",
and "Handles dgGrid.CancelCo mmand" options (again see the
code below).
The problem is that edit and delete work perfectly but I
can not get the cancel and update commands to fire. All
they do is cause a postback. Any suggestions?
Code from webform1.aspx (headers only)
--------------------------------------------------------
Sub dgGrid_Edit(ByV al sender As Object, ByVal e As
DataGridCommand EventArgs) Handles dgGrid.EditComm and
Sub dgGrid_Cancel(B yVal sender As Object, ByVal e As
DataGridCommand EventArgs) Handles dgGrid.CancelCo mmand
Sub dgGrid_Delete(B yVal sender As Object, ByVal e As
DataGridCommand EventArgs) Handles dgGrid.DeleteCo mmand
Sub dgGrid_Update(B yVal sender As Object, ByVal e As
DataGridCommand EventArgs) Handles dgGrid.UpdateCo mmand
Code from templates
-------------------------------------------------------
Case ListItemType.It em
Dim ctl As New LinkButton
ctl.ID = "lnkbutEdit "
ctl.Width = Unit.Pixel(16)
ctl.Text = "<img border=0
src=images/im_edit.gif alt=edit>"
ctl.CommandName = "Edit"
ctl.CausesValid ation = False
container.Contr ols.Add(ctl)
Case ListItemType.Ed itItem
'Save
Dim ctl1 As New LinkButton
ctl1.ID = "lnkbutUpda te"
ctl1.Width = Unit.Pixel(16)
ctl1.Text = "<img border=0
src=images/im_update.gif alt=update>"
ctl1.CommandNam e = "Update"
ctl1.CausesVali dation = True
container.Contr ols.Add(ctl1)
Comment