Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. help

help

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdesignhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    V Sen
    wrote on last edited by
    #1

    Datagrid with checkbox using asp.net.so i will select checkbox and the show to datagird datas show in lable,datagrid using paging concept,I need select checkbox in page 1 some datas and then select page 2 in some datas.but i can't any one only.Any body know,tell immediately...and thanks......... Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ldstdateset As New DataSet Dim lobjdatatier As New TicDataTier ldstdateset = lobjdatatier.ExecStoredProc("TIC_GET_tTic_MM_Modules", lstrparameter, "Gmdataset") Me.MyDataGrid1.DataSource = ldstdateset.Tables(0) Me.MyDataGrid1.DataBind() End Sub Private Sub MyDataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles MyDataGrid1.PageIndexChanged Me.MyDataGrid1.CurrentPageIndex = e.NewPageIndex Me.MyDataGrid1.DataBind() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Integer = 0 Dim mySelection As StringBuilder = New StringBuilder mySelection.Append("Selected Row(s):<hr><br>") Dim GridItem As DataGridItem For Each GridItem In MyDataGrid1.Items Dim myCheckbox As CheckBox = CType(GridItem.Cells(0).Controls(1), CheckBox) If myCheckbox.Checked = True Then i = i + 1 mySelection.AppendFormat("{0}<br>", GridItem.Cells(1).Text) ' mySelection.Append("<hr>") mySelection.AppendFormat("{0}<br>", GridItem.Cells(2).Text) End If Next mySelection.Append("<br>") mySelection.Append("<hr>") mySelection.AppendFormat("Total selected Value is: {0}<br>", i.ToString()) Me.Label1.Text = mySelection.ToString.Trim() End Sub Private Sub MyDataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles MyDataGrid1.PageIndexChanged Me.MyDataGrid1.CurrentPageIndex = e.NewPageIndex Me.MyDataGrid1.DataBind() End Sub And once again thanks regards, sen.V

    F 1 Reply Last reply
    0
    • V V Sen

      Datagrid with checkbox using asp.net.so i will select checkbox and the show to datagird datas show in lable,datagrid using paging concept,I need select checkbox in page 1 some datas and then select page 2 in some datas.but i can't any one only.Any body know,tell immediately...and thanks......... Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ldstdateset As New DataSet Dim lobjdatatier As New TicDataTier ldstdateset = lobjdatatier.ExecStoredProc("TIC_GET_tTic_MM_Modules", lstrparameter, "Gmdataset") Me.MyDataGrid1.DataSource = ldstdateset.Tables(0) Me.MyDataGrid1.DataBind() End Sub Private Sub MyDataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles MyDataGrid1.PageIndexChanged Me.MyDataGrid1.CurrentPageIndex = e.NewPageIndex Me.MyDataGrid1.DataBind() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Integer = 0 Dim mySelection As StringBuilder = New StringBuilder mySelection.Append("Selected Row(s):<hr><br>") Dim GridItem As DataGridItem For Each GridItem In MyDataGrid1.Items Dim myCheckbox As CheckBox = CType(GridItem.Cells(0).Controls(1), CheckBox) If myCheckbox.Checked = True Then i = i + 1 mySelection.AppendFormat("{0}<br>", GridItem.Cells(1).Text) ' mySelection.Append("<hr>") mySelection.AppendFormat("{0}<br>", GridItem.Cells(2).Text) End If Next mySelection.Append("<br>") mySelection.Append("<hr>") mySelection.AppendFormat("Total selected Value is: {0}<br>", i.ToString()) Me.Label1.Text = mySelection.ToString.Trim() End Sub Private Sub MyDataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles MyDataGrid1.PageIndexChanged Me.MyDataGrid1.CurrentPageIndex = e.NewPageIndex Me.MyDataGrid1.DataBind() End Sub And once again thanks regards, sen.V

      F Offline
      F Offline
      farazsk11
      wrote on last edited by
      #2

      Hi, what i believe you will be required to create a method that will check the selected rows of the grid view. when the page is changing call that method and store the selected row in a session. on the next page when user select rows repeat the same process. note that the method will not only be called no the page index change but also where there is some post back on the page. hope it will help.

      Faraz Shah Khan MCP, MCAD.Net Blog

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups