Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting all selected values from Grid Row
    primarykey
    data
    text
    <p>I had a gridview (Having 10 rows). Each row contains only one column, which has 1 checkbox, 2 dropdowns, 1 radiobutton list.</p> <p>Now I need to get the selected values into List based on checkbox selected. I mean, if I checked first checkbox, first value in IList should have the name of that checkbox and its selected values of dropdowns and radiobuttonlist.</p> <p>how this can be achieved? Can anyone help me on this?</p> <pre><code>/* Properties to get selected values */ public string SelectedChekbox { get { return _selectedChekbox; } set { _selectedChekbox = value; } } public string Ddl1Value { get { return _ddl1Value; } set { _ddl1Value = value; } } public string Ddl2Value { get { return _ddl2Value; } set { _ddl2Value = value; } } /* This is the property in which I need values*/ public string SelectedGridValues { get { return _selectedGridValues; } set { _selectedGridValues = value; } } /* To get the selected values of grid into list*/ /*** This was incomplete code. Need help to improve this ***/ private IList&lt;MyList&gt; LoadList() { foreach (DataListItem dlItem in dlDataList.Items) { GridView grid = (GridView)dlItem.FindControl("gvGridList"); if (grid != null) { foreach (GridViewRow gridRow in grid.Rows) { CheckBox chk = gridRow.FindControl("chkSelect") as CheckBox; RadioButton rdo = gridRow.FindControl("rdoSelect") as RadioButton; DropDownList ddl1Value = gridRow.FindControl("ddl1") as DropDownList; DropDownList ddl1Value = gridRow.FindControl("ddl2") as DropDownList; if (chk.Checked &amp;&amp; chk.Text == Name) { _selectedGraph = chk.Text; _ddl1Value = ddl1.SelectedValue; _ddl1Value = ddl2.SelectedValue; } } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload