We help IT Professionals succeed at work.

what is edititemindex for gridview?

1,163 Views
Last Modified: 2013-11-07
what I can use instead of instead of edititemindex for gridview it doesn't like that, I had that for datagrid.
GridView1.EditItemIndex = current_row
GridView1.EditItemIndex = -1
Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
basically I have this how can I convert?
 Dim dgItem As DataGridItem = CType(ck1.Parent.Parent, DataGridItem)
        Dim current_row As Integer = dgItem.ItemIndex
 GridView1.EditIndex = current_row
GridView1.EditIndex = -1

Author

Commented:
sorry I have this
Dim dgItem As DataGridItem = CType(ck1.Parent.Parent, DataGridItem)
        Dim current_row As Integer = dgItem.ItemIndex
dg.EditItemIndex = current_row
 dg.EditItemIndex = -1

I converted this to previous posting above, is it correct?

Commented:
this is my gridview declaration
<asp:GridView ID="uxItemDetailGrid" runat="server" ShowFooter="true" AutoGenerateColumns="false"  HorizontalAlign="center" HeaderStyle-Height="40" CellPadding="2"  BorderColor="#A1C1D9"  GridLines="Both" RowStyle-Font-Size="8"  AutoGenerateEditButton="True" OnRowEditing="uxItemDetailGrid_RowEditing" OnRowCancelingEdit="uxItemDetailGrid_RowCancelingEdit" OnRowUpdating="uxItemDetailGrid_RowUpdating" OnRowCommand = "uxItemDetailGrid_RowCommand" OnRowCreated = "uxItemDetailGrid_RowCreated">

this is my proc:
 Protected Sub uxItemDetailGrid_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
      uxItemDetailGrid.EditItemIndex = e.EditItemIndex
      Bind()
 End Sub

this is my error---

Compiler Error Message: BC30456: 'EditItemIndex' is not a member of 'System.Web.UI.WebControls.GridView'.

Source Error:
Line 481:
Line 482:     Protected Sub uxItemDetailGrid_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
Line 483:      uxItemDetailGrid.EditItemIndex = e.EditItemIndex
Line 484:      Bind()
Line 485:     End Sub
 





       

Commented:
Hoops I have already a proc named

 Protected Sub uxItemDetailGrid_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs)
       
        uxItemDetailGrid.EditIndex = e.NewEditIndex
 
        bind()
  End Sub

this does not give me compile errors ... Yet I still have a problem with edit sync up to the right row number ID

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.