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

how reach check Box column in cline side?

1 Answer 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
samaneh
Top achievements
Rank 1
samaneh asked on 22 Apr 2012, 05:18 AM
hi all
I have 2 templateColumn in my RadGrid
first column has RadNumericTextBox and second column,contains Checkbox

I want in clientSide, when user enter a number in textbox, the checkbox of that row,be CHECKED.

how can I do that?

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 23 Apr 2012, 06:26 AM
Hi Samaneh,

Please try the following code snippet to check the Checkbox when user enters number in RadNumericTextBox.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
   if (e.Item is GridDataItem)
   {
     GridDataItem item=(GridDataItem)e.Item;
     RadNumericTextBox txt = (RadNumericTextBox)item.FindControl("RadNumericTextBoxID");
     int index = e.Item.ItemIndex;
     txt.ClientEvents.OnValueChanged = "function (sender,args){rowIndex('" + index + "');}";
   }
}

Javascript:
<script type="text/javascript">
    function rowIndex(index) {
        var row = $find('<%= RadGrid1.ClientID %>').get_masterTableView().get_dataItems()[index];
        row.findElement("CheckBoxID").checked = true;
    }
</script>

Thanks,
Shinu.
Tags
Grid
Asked by
samaneh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or