|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
editing datagrid
<i><b>Originally posted by : Karin Vanderheide (kvdheide@godutch.com)</b></i><br />Hello I seem to be having problems using the OnUpdateCommand and OnCancelCommand in my datagrid: can anyone see where my error is?<br /><br />When I use the edit button... the boundcolumn turn to textboxes and I receive the response.write message "edit row".<br /><br />However, when i click on the update or cancel button nothing changes... it's like the function in never invoked or run. the response.writes' don't display either.<br /><br />please help! <br /><br />i can't look at it anymore.<br /><br /><br /><!-- datagrid --><br /><asp
ataGrid id="CustomerDataGrid" runat="server" <br />autogeneratecolumns=""FALSE""<br />width="85%" <br />HorizontalAlign="center"<br />CellPadding="4" <br />CellSpacing="0"<br />BorderColor="Black" BorderWidth="1"<br />ItemStyle-VerticalAlign="top"<br />OnPageIndexChanged="PageIndexChanged_OnClick"<br />PagerStyle-Mode="NumericPages"<br />PagerStyle-HorizontalAlign="center" <br />PageSize="5"<br />PagerStyle-VerticalAlign="top"<br />AllowPaging=""TRUE""<br />OnEditCommand="EditRow"<br />OnUpdateCommand="UpdateRow"<br />OnCancelCommand="CancelUpdate"<br />DataKeyField="id" ><br /> <br /><HeaderStyle BackColor="#C0C0C0" Font-Bold=""TRUE"" /><br /><Columns><br /><br /><asp:EditCommandColumn HeaderText="Edit" EditText="Edit" UpdateText="Update" CancelText="Cancel" /><br /><br /><asp:BoundColumn DataField="id" HeaderText="ID" ReadOnly=""TRUE"" /><br /><br /><asp:BoundColumn DataField="title" HeaderText="Title"/><br /><br /><asp:BoundColumn DataField="notes" HeaderText="notes" /><br /><br /></Columns><br /></asp ataGrid><br /><br /><br />'Edit row<br />public sub EditRow(sender as Object, e as DataGridCommandEventArgs)<br /><br /> response.write("<br/>edit row")<br /> CustomerDataGrid.EditItemIndex = e.Item.ItemIndex<br /> BindData(sorting,filter)<br /><br />end sub<br /><br /><br />public sub CancelUpdate(sender as Object, e as DataGridCommandEventArgs)<br /><br /> response.write("<br/>cancel update")<br /> CustomerDataGrid.EditItemIndex = -1<br /> BindData(sorting,filter)<br /><br />end sub<br /><br /><br />public sub UpdateRow(sender as Object,e as DataGridCommandEventArgs)<br /><br /> response.write("<br/>update row")<br /><br /> Dim editTitle As TextBox = CType(e.Item.Cells(2).Controls(0), TextBox)<br /><br /> Dim Item as String = e.Item.Cells(1).Text<br /> Dim title As String = editTitle.Text <br /><br /> response.write(Item & title)<br /><br /> CustomerDataGrid.EditItemIndex= -1<br /> BindData(sorting,filter)<br /><br />end sub<br /><br /><br /><br /> |
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : dsasa (sadasdsasada)</b></i><br /><br /><br /><br />------------<br />Karin Vanderheide at 4/17/2002 3:54:53 PM<br /><br />Hello I seem to be having problems using the OnUpdateCommand and OnCancelCommand in my datagrid: can anyone see where my error is?<br /><br />When I use the edit button... the boundcolumn turn to textboxes and I receive the response.write message "edit row".<br /><br />However, when i click on the update or cancel button nothing changes... it's like the function in never invoked or run. the response.writes' don't display either.<br /><br />please help! <br /><br />i can't look at it anymore.<br /><br /><br /><!-- datagrid --><br /><asp
ataGrid id="CustomerDataGrid" runat="server" <br />autogeneratecolumns=""FALSE""<br />width="85%" <br />HorizontalAlign="center"<br />CellPadding="4" <br />CellSpacing="0"<br />BorderColor="Black" BorderWidth="1"<br />ItemStyle-VerticalAlign="top"<br />OnPageIndexChanged="PageIndexChanged_OnClick"<br />PagerStyle-Mode="NumericPages"<br />PagerStyle-HorizontalAlign="center" <br />PageSize="5"<br />PagerStyle-VerticalAlign="top"<br />AllowPaging=""TRUE""<br />OnEditCommand="EditRow"<br />OnUpdateCommand="UpdateRow"<br />OnCancelCommand="CancelUpdate"<br />DataKeyField="id" ><br /> <br /><HeaderStyle BackColor="#C0C0C0" Font-Bold=""TRUE"" /><br /><Columns><br /><br /><asp:EditCommandColumn HeaderText="Edit" EditText="Edit" UpdateText="Update" CancelText="Cancel" /><br /><br /><asp:BoundColumn DataField="id" HeaderText="ID" ReadOnly=""TRUE"" /><br /><br /><asp:BoundColumn DataField="title" HeaderText="Title"/><br /><br /><asp:BoundColumn DataField="notes" HeaderText="notes" /><br /><br /></Columns><br /></asp ataGrid><br /><br /><br />'Edit row<br />public sub EditRow(sender as Object, e as DataGridCommandEventArgs)<br /><br /> response.write("<br/>edit row")<br /> CustomerDataGrid.EditItemIndex = e.Item.ItemIndex<br /> BindData(sorting,filter)<br /><br />end sub<br /><br /><br />public sub CancelUpdate(sender as Object, e as DataGridCommandEventArgs)<br /><br /> response.write("<br/>cancel update")<br /> CustomerDataGrid.EditItemIndex = -1<br /> BindData(sorting,filter)<br /><br />end sub<br /><br /><br />public sub UpdateRow(sender as Object,e as DataGridCommandEventArgs)<br /><br /> response.write("<br/>update row")<br /><br /> Dim editTitle As TextBox = CType(e.Item.Cells(2).Controls(0), TextBox)<br /><br /> Dim Item as String = e.Item.Cells(1).Text<br /> Dim title As String = editTitle.Text <br /><br /> response.write(Item & title)<br /><br /> CustomerDataGrid.EditItemIndex= -1<br /> BindData(sorting,filter)<br /><br />end sub<br /><br /><br /><br /> |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > editing datagrid |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|