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