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. check radiobutton value in inner datagrid problem

check radiobutton value in inner datagrid problem

Scheduled Pinned Locked Moved ASP.NET
dockerhardwarehelpquestion
4 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.
  • B Offline
    B Offline
    beastyboy
    wrote on last edited by
    #1

    Hello people, I'm dealing with something I can't figure out: I have embedded a datagrid into another one. The first column of the inner datagrid contains a custom radiobutton! <%# Container.DataItem("Question") %>
    In the OnItemBound procedure of gridQuestions I built the gridAnswers further up. So far so good. At this moment, when I run the project, the two datagrids are filled with the right data and a user can click the answers for every question. Next, there's a button on the page 'finish exam'. When I click this button, the result of the answers should be calculated. I have the following code: Dim intCorrect As Integer Dim gridQuestionsItem As DataGridItem Dim gridAnsw As DataGrid Dim gridAnswItem As DataGridItem Dim intCount As Integer = 0 Dim intPtn As Integer = 0 For Each gridQuestionsItem In gridQuestions.Items

    G 1 Reply Last reply
    0
    • B beastyboy

      Hello people, I'm dealing with something I can't figure out: I have embedded a datagrid into another one. The first column of the inner datagrid contains a custom radiobutton! <%# Container.DataItem("Question") %>
      In the OnItemBound procedure of gridQuestions I built the gridAnswers further up. So far so good. At this moment, when I run the project, the two datagrids are filled with the right data and a user can click the answers for every question. Next, there's a button on the page 'finish exam'. When I click this button, the result of the answers should be calculated. I have the following code: Dim intCorrect As Integer Dim gridQuestionsItem As DataGridItem Dim gridAnsw As DataGrid Dim gridAnswItem As DataGridItem Dim intCount As Integer = 0 Dim intPtn As Integer = 0 For Each gridQuestionsItem In gridQuestions.Items

      G Offline
      G Offline
      gnjunge
      wrote on last edited by
      #2

      You will need a special radiobutton column to do this. Checkout: For articles: http://aspnet.4guysfromrolla.com/articles/122602-1.2.aspx[^] http://www.codeproject.com/aspnet/datagridcheckboxcol.asp[^] A component you can download: http://www.metabuilders.com/Tools/RowSelectorColumn.aspx[^] Hope this helps, Gideon ps. Stop using the old VB code, such as CStr and CInt, go over to the .NET way: .ToString or Convert.ToString(), Convert.ToInt32

      B 2 Replies Last reply
      0
      • G gnjunge

        You will need a special radiobutton column to do this. Checkout: For articles: http://aspnet.4guysfromrolla.com/articles/122602-1.2.aspx[^] http://www.codeproject.com/aspnet/datagridcheckboxcol.asp[^] A component you can download: http://www.metabuilders.com/Tools/RowSelectorColumn.aspx[^] Hope this helps, Gideon ps. Stop using the old VB code, such as CStr and CInt, go over to the .NET way: .ToString or Convert.ToString(), Convert.ToInt32

        B Offline
        B Offline
        beastyboy
        wrote on last edited by
        #3

        Thx for your the reply Gideon, I ám using a custom radiobutton and I'm also using it in a simple datagrid. When it's in one datagrid, it works fine... I can get the value of each radiobutton. The problem seems to be the fact that I have placed my 'custom' radiobutton in a datagrid that itself is embedded into another datagrid. I think I cannot retrieve values from an inner datagrid this way! But maybe somebody DOES know a way to fix this problem?! Still going to read the articles in your post!! Thx a lot! deef respect 2B respected

        1 Reply Last reply
        0
        • G gnjunge

          You will need a special radiobutton column to do this. Checkout: For articles: http://aspnet.4guysfromrolla.com/articles/122602-1.2.aspx[^] http://www.codeproject.com/aspnet/datagridcheckboxcol.asp[^] A component you can download: http://www.metabuilders.com/Tools/RowSelectorColumn.aspx[^] Hope this helps, Gideon ps. Stop using the old VB code, such as CStr and CInt, go over to the .NET way: .ToString or Convert.ToString(), Convert.ToInt32

          B Offline
          B Offline
          beastyboy
          wrote on last edited by
          #4

          I tried to put the RowSelectorColumn control in the inner datagrid of two datagrids, but it doesn't work !!! Code says that I didn't select any item which is certainly not true! I believe it's a problem with embedding one datagrid into another. Another thing is that if I use 'ctrl+spacebar' in vb code, I see my main datagrid, but I don't see the inner datagrid in the list!! So I have to get it via FindControls("innerGrid") or something like that! It's a pity that it doesn't work.. it would be a great solution for my situation here. Damn respect 2B respected

          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