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. DataView and its DataSource

DataView and its DataSource

Scheduled Pinned Locked Moved ASP.NET
5 Posts 4 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.
  • A Offline
    A Offline
    allende
    wrote on last edited by
    #1

    Hi friends, I have a page with a dataview binded to a datatable. I want to delete all the rows with a checkbox marked on it. The problem is that in the button's OnClick event the DataSource property of the DataView is NULL. I cant have access to it in order to know the IDs of the marked rows. How can I do this? Thanks averyone

    T V J 3 Replies Last reply
    0
    • A allende

      Hi friends, I have a page with a dataview binded to a datatable. I want to delete all the rows with a checkbox marked on it. The problem is that in the button's OnClick event the DataSource property of the DataView is NULL. I cant have access to it in order to know the IDs of the marked rows. How can I do this? Thanks averyone

      T Offline
      T Offline
      thomas_joyee
      wrote on last edited by
      #2

      You need to cache the datatable because in every post back the datatable will be cleared.

      Thomas

      1 Reply Last reply
      0
      • A allende

        Hi friends, I have a page with a dataview binded to a datatable. I want to delete all the rows with a checkbox marked on it. The problem is that in the button's OnClick event the DataSource property of the DataView is NULL. I cant have access to it in order to know the IDs of the marked rows. How can I do this? Thanks averyone

        V Offline
        V Offline
        Venkatesh Mookkan
        wrote on last edited by
        #3

        In which event you are binding the DataView?

        Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group

        1 Reply Last reply
        0
        • A allende

          Hi friends, I have a page with a dataview binded to a datatable. I want to delete all the rows with a checkbox marked on it. The problem is that in the button's OnClick event the DataSource property of the DataView is NULL. I cant have access to it in order to know the IDs of the marked rows. How can I do this? Thanks averyone

          J Offline
          J Offline
          JustChiragPatel
          wrote on last edited by
          #4

          just declare your DataTable as static , and get data in DataTable like.. public Static DataTable dt = new DataTable(); if(!IsPostBack) { dt = //some binding code... } now you will not lost data from datatable.. bye have a nice day. Chirag Patel

          A 1 Reply Last reply
          0
          • J JustChiragPatel

            just declare your DataTable as static , and get data in DataTable like.. public Static DataTable dt = new DataTable(); if(!IsPostBack) { dt = //some binding code... } now you will not lost data from datatable.. bye have a nice day. Chirag Patel

            A Offline
            A Offline
            allende
            wrote on last edited by
            #5

            Thanks a lot to all of you. JustChiragPatel, your solution was the one!!!

            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