golerose
پنج شنبه 19 بهمن 1391, 20:03 عصر
سلام
من یه مشکلی دارم که اگه پروژه رو اجرا کنم محصولات در datalist ظاهر نمیشن
میشه کمکم کنید بگید مشکل از کجاش
این عکس desigin
99708
وقتی هم اجراش میکنم اینجوری میشه
http://upload.tehran98.com/img1/hxjc2abnpac9h98lg08.png
کد در رویداد clic
99707
نمایش سبد خرید و امکان ویرایش آن و نهایی نمودن خرید
Protected Sub CartGrid_RowCancelingEdit(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventA rgs)
Handles CartGrid.RowCancelingEdit
CartGrid.EditIndex = -1
bindgrid()
System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles
CartGrid.RowDeleting
Profile.Cart.Items.RemoveAt(e.RowIndex)
bindgrid()
End Sub
Protected Sub CartGrid_RowUpdating(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
CartGrid.RowUpdating
Dim qtytextbox As TextBox =
Ctype(CartGrid.Rows(e.RowIndex).Cells(2).Controls( 0), TextBox)
Dim qty As Integer = Convert.ToInt32(qtytextbox.Text)
If qty = 0 Then
Profile.Cart.Items.RemoveAt(e.RowIndex)
Else
Profile.Cart.Items(e.RowIndex).qty = qty
End If
CartGrid.EditIndex = -1
bindgrid()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Profile.Cart Is Nothing Then
Return
End If
If Not Page.IsPostBack Then
bindgrid()
End If
If Profile.Cart.Items.Count = 0 Then
totallabel.Visible = False
End If
totallabel.Text = String.Format(“ ,”ریال { 0} :کل جمع
Profile.Cart.Total)
End Sub
Private Sub bindgrid()
CartGrid.DataSource = Profile.Cart.Items
DataBind()
totallabel.Text = String.Format(“ ,”ریال { 0} :کل جمع
Profile.Cart.Total)
End Sub
Protected Sub CartGrid_RowEditing(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewEditEventArgs)
CartGrid.EditIndex = e.NewEditIndex
bindgrid()
End Sub
</script>
End Sub
من یه مشکلی دارم که اگه پروژه رو اجرا کنم محصولات در datalist ظاهر نمیشن
میشه کمکم کنید بگید مشکل از کجاش
این عکس desigin
99708
وقتی هم اجراش میکنم اینجوری میشه
http://upload.tehran98.com/img1/hxjc2abnpac9h98lg08.png
کد در رویداد clic
99707
نمایش سبد خرید و امکان ویرایش آن و نهایی نمودن خرید
Protected Sub CartGrid_RowCancelingEdit(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventA rgs)
Handles CartGrid.RowCancelingEdit
CartGrid.EditIndex = -1
bindgrid()
System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles
CartGrid.RowDeleting
Profile.Cart.Items.RemoveAt(e.RowIndex)
bindgrid()
End Sub
Protected Sub CartGrid_RowUpdating(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
CartGrid.RowUpdating
Dim qtytextbox As TextBox =
Ctype(CartGrid.Rows(e.RowIndex).Cells(2).Controls( 0), TextBox)
Dim qty As Integer = Convert.ToInt32(qtytextbox.Text)
If qty = 0 Then
Profile.Cart.Items.RemoveAt(e.RowIndex)
Else
Profile.Cart.Items(e.RowIndex).qty = qty
End If
CartGrid.EditIndex = -1
bindgrid()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Profile.Cart Is Nothing Then
Return
End If
If Not Page.IsPostBack Then
bindgrid()
End If
If Profile.Cart.Items.Count = 0 Then
totallabel.Visible = False
End If
totallabel.Text = String.Format(“ ,”ریال { 0} :کل جمع
Profile.Cart.Total)
End Sub
Private Sub bindgrid()
CartGrid.DataSource = Profile.Cart.Items
DataBind()
totallabel.Text = String.Format(“ ,”ریال { 0} :کل جمع
Profile.Cart.Total)
End Sub
Protected Sub CartGrid_RowEditing(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewEditEventArgs)
CartGrid.EditIndex = e.NewEditIndex
bindgrid()
End Sub
</script>
End Sub