Hi everybody, as my title says, i have a GridClientSelectColumn, on my radGrid, and a button outside this grid, in this button, i try to get all checked check box on this way:
but if i try this way, i will get one by one valuee from checkbox that are checked.
Exist some way to get ALL rows that my gridClient are selected?
Thankz in advance
protected
void
btnDel_Click(
object
sender, EventArgs e)
{
string
id;
bool
chec;
foreach
(GridDataItem item
in
RadGrid2.Items)
{
CheckBox chk = (CheckBox)item[
"CheckboxColumn"
].Controls[0];
id = item[
"codigo"
].Text;
chec= chk.Checked;
}
}
but if i try this way, i will get one by one valuee from checkbox that are checked.
Exist some way to get ALL rows that my gridClient are selected?
Thankz in advance
<
telerik:RadGrid
ID
=
"RadGrid2"
runat
=
"server"
AllowMultiRowSelection
=
"true"
Width
=
"300px"
OnNeedDataSource
=
"RadGrid2_NeedDataSource"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
CommandItemDisplay
=
"Top"
CommandItemSettings-AddNewRecordText
=
"Novo Registro"
CommandItemSettings-RefreshText
=
"Atualizar"
DataKeyNames
=
"codigo"
>
<
Columns
>
<
telerik:GridClientSelectColumn
UniqueName
=
"CheckboxColumn"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Código"
DataField
=
"codigo"
UniqueName
=
"codigo"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Descrição"
DataField
=
"descricao"
UniqueName
=
"descricao"
/>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
EnablePostBackOnRowClick
=
"True"
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
<
asp:Button
ID
=
"btnDeletar"
CommandName
=
"Delete"
runat
=
"server"
Text
=
"Deletar Items"
onclick
=
"btnDeletar_Click"
/>