الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

التعديل على الgridview بالكود مشكلة في تحويل يمكن

بدأه eng usama في 14 نوفمبر 2009 · 1 رد · 423 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم .......اود طرح مشكلة وهي في حالة ضغط زر التحديث( حفظ التعديلRowUpdating )في ال Grid View

Protected Sub GV_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GV.RowUpdating

Dim TextId As TextBox = GV.DataKeys(e.RowIndex).Value

Dim TextAddress As TextBox = CType(GV.Rows(e.RowIndex).Cells(1).Controls(1), TextBox)

If (da.UpdateText(TextId, TextAddress) > 0) Then // UpdateText(TextId, TextAddress) دالة في الكلاس

GV.EditIndex = -1

DataBind()

End If

End Sub

ورسالة الخطاء

Argument 'Prompt' cannot be converted to type 'String'.

السلام عليكم .......اود طرح مشكلة وهي في حالة ضغط زر التحديث

( حفظ التعديلRowUpdating )

في ال Grid View

Protected Sub GV_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GV.RowUpdating

Dim TextId As TextBox = GV.DataKeys(e.RowIndex).Value

Dim TextAddress As TextBox = CType(GV.Rows(e.RowIndex).Cells(1).Controls(1), TextBox)

If (da.UpdateText(TextId, TextAddress) > 0) Then

/////////////////////// UpdateText(TextId, TextAddress) دالة في الكلاس

GV.EditIndex = -1

DataBind()

End If

End Sub

ورسالة الخطاء

Argument 'Prompt' cannot be converted to type 'String'.

#2

الحمد لله توصلت لحل وتعلمت الكثير وانا بابحث والكود لكم للفائدة

Protected Sub GV_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GV.RowUpdating

Dim TextId As String = CType(GV.Rows(e.RowIndex).Cells(0).Controls.Item(1), TextBox).Text

Dim TextAddress As String = CType(GV.Rows(e.RowIndex).Cells(1).Controls.Item(1), TextBox).Text

Dim TextBodyfath As String = CType(GV.Rows(e.RowIndex).Cells(2).Controls.Item(1), TextBox).Text

Dim TextAddressEn As String = CType(GV.Rows(e.RowIndex).Cells(3).Controls.Item(1), TextBox).Text

Dim TextBodyfathEn As String = CType(GV.Rows(e.RowIndex).Cells(4).Controls.Item(1), TextBox).Text

Dim CompanyId As String = CType(GV.Rows(e.RowIndex).Cells(5).Controls.Item(1), TextBox).Text



If (da.UpdateText(TextId, TextAddress, TextBodyfath, TextAddressEn, TextBodyfathEn, CompanyId)) > 0 Then

GV.EditIndex = -1

DataBind()

End If





End Sub

مواضيع مشابهة