I am trying to get the Checked value of the check box, such as true or false in a RadGrid and for some reason it always says that the value is false.
This is my Grid:
This my C#:
Any help would be great!
Thanks!
This is my Grid:
<
telerik:radgrid
id
=
"grdLeadList"
runat
=
"server"
autogeneratecolumns
=
"false"
allowpaging
=
"True"
allowsorting
=
"True"
pagesize
=
"5"
allowautomaticupdates
=
"true"
gridlines
=
"None"
allowmultirowselection
=
"true"
onitemcommand
=
"grdLeadList_ItemCommand"
DataKeyNames
=
"opportunityid"
style
=
"float: left; width: 965px;"
>
<
ExportSettings
HideStructureColumns
=
"true"
>
<
Excel
Format
=
"ExcelML"
/>
<
Csv
ColumnDelimiter
=
"Comma"
RowDelimiter
=
"NewLine"
/>
<
Pdf
/>
</
ExportSettings
>
<
PagerStyle
Mode
=
"NextPrevNumericAndAdvanced"
/>
<
MasterTableView
Width
=
"100%"
TableLayout
=
"Auto"
>
<
CommandItemSettings
ShowExportToExcelButton
=
"false"
ShowExportToCsvButton
=
"false"
ShowExportToPdfButton
=
"false"
ShowAddNewRecordButton
=
"false"
/>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"CkhSelect"
HeaderText
=
"Select"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"chkbxselect"
runat
=
"server"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"LinkButton"
UpdateText
=
"Update"
CancelText
=
"Cancel"
EditText
=
"Edit"
/>
<
telerik:GridBoundColumn
DataField
=
"CustomerId"
HeaderText
=
"Company Name"
SortExpression
=
"CompanyName"
UniqueName
=
"CompanyName"
/>
<
telerik:GridBoundColumn
DataField
=
"Priority"
HeaderText
=
"Priority"
SortExpression
=
"Priority"
UniqueName
=
"Priority"
/>
<
telerik:GridBoundColumn
DataField
=
"Eval"
HeaderText
=
"Eval"
SortExpression
=
"Eval"
UniqueName
=
"Eval"
/>
<
telerik:GridBoundColumn
DataField
=
"ContactName"
HeaderText
=
"Contact Name"
SortExpression
=
"ContactName"
UniqueName
=
"ContactName"
/>
<
telerik:GridBoundColumn
DataField
=
"Source"
HeaderText
=
"Source"
SortExpression
=
"Source"
UniqueName
=
"Source"
/>
<
telerik:GridBoundColumn
DataField
=
"State"
HeaderText
=
"State"
SortExpression
=
"State"
UniqueName
=
"State"
/>
<
telerik:GridNumericColumn
DataField
=
"Zip"
HeaderText
=
"Zip"
SortExpression
=
"Zip"
UniqueName
=
"Zip"
/>
<
telerik:GridDateTimeColumn
DataField
=
"CreatedOn"
DataFormatString
=
"{0:MM/dd/yy}"
HeaderText
=
"Creation Date"
SortExpression
=
"CreationDate"
UniqueName
=
"CreationDate"
/>
</
Columns
>
<
EditFormSettings
UserControlName
=
"EditPanel.ascx"
EditFormType
=
"WebUserControl"
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
/>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"false"
>
<
Selecting
AllowRowSelect
=
"True"
/>
</
ClientSettings
>
</
telerik:radgrid
>
This my C#:
protected
void
imgBtnSendRecords_Click(
object
sender, ImageClickEventArgs e)
{
string
mail =
""
;
foreach
(GridDataItem item
in
grdLeadList.MasterTableView.Items)
//loop through each grid item
{
CheckBox chkSelected = (CheckBox)item.FindControl(
"chkbxselect"
);
if
(chkSelected.Checked ==
true
)
{
mail = mail + item[
"Priority"
].Text +
" "
;
}
}
}
Any help would be great!
Thanks!