This is a migrated thread and some comments may be shown as answers.

[Solved] ChildGridView + Multiple Radio Button in A Row + Single select a Radio Buttons per Row

0 Answers 292 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Krishna Kishor Bhat
Top achievements
Rank 1
Krishna Kishor Bhat asked on 09 Nov 2009, 02:01 PM
Hi,

I have Hierarchical Grid with the child gridview having two radio buttons per row (say - Yes or No columns)
There can be more than one rows in a child gridview. In this case how can I do the coding for the Q3 release.

I was previously able to implement the requirement using Q2 release; the code is like this

if (!(e.Row is GridViewNewRow) && !(e.Row is GridViewHeaderRow)) 
                { 
                    var cellSafe = e.Row.Cells.Where(c => c.Column.UniqueName == "grdcolSafe").FirstOrDefault(); 
                    var cellAtRisk = e.Row.Cells.Where(c => c.Column.UniqueName == "grdcolAtRisk").FirstOrDefault(); 
                    if (cellSafe != null
                    { 
                        var radioButton = cellSafe.ChildrenOfType<RadioButton>().FirstOrDefault(); 
                        if (radioButton != null
                        { 
                            radioButton.GroupName = "grpSubCategory" + (e.DataElement).CategoryId.ToString(); 
                        } 
                    } 
 
                    if (cellAtRisk != null
                    { 
                        var radioButton = cellAtRisk.ChildrenOfType<RadioButton>().FirstOrDefault(); 
                        if (radioButton != null
                        { 
                            radioButton.GroupName = "grpSubCategory" + (e.DataElement).CategoryId.ToString(); 
                        } 
                    } 
                } 

My approach was to set the unique GroupNames for each row in child gridview.

Can you please help.

Thanks,
Krishna


Tags
GridView
Asked by
Krishna Kishor Bhat
Top achievements
Rank 1
Share this question
or