datalist command

Results 1 to 2 of 2

Thread: datalist command

  1. #1
    Join Date
    Dec 1969

    Default datalist command

    Can anyone explain to me why I cannot get my OnEditCommand to work? The datalist comes up with all the correct fields but when I click on the edit button it just stays at the Item part of the datalist. I tried putting some break points in the DoItemEdit sub routine but it never hits that line of code. any ideas on where I should be looking to resolve this? Here is some of my code.<BR><BR>&#060;asp:datalist id="Datalist" style="Z-INDEX: 107; LEFT: 13px; POSITION: absolute; TOP: 156px" runat="server" ItemStyle-BorderColor="#6600ff" ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="5" OnDeleteCommand="DoItemDelete" DataKeyField="id" OnCancelCommand="DoCancel" OnEditCommand="DoEdit" OnUpdateCommand="DoUpdate"&#062;<BR><BR>Here is the VB part it should be calling<BR>&#039;-----------------------------------------------------<BR>Sub DoEdit(ByVal objSource As Object, ByVal objArgs As DataListCommandEventArgs)<BR><BR> lblDisplay.Text = "this is working!!!!!!!"<BR> Datalist.SelectedIndex = -1<BR> Datalist.EditItemIndex = objArgs.Item.ItemIndex<BR><BR> dataresults()<BR><BR> End Sub<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: datalist command

    Not sure if this is the problem but for testing purposes you might want to try it.<BR><BR>Try using the standards of naming the Object and EventArgs:<BR>Sub DoEdit(ByVal sender As Object,ByVal e as DataListCommandEventArgs)<BR><BR>hth<BR>David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts