Hi Monika
No need to create itemdatabound for this grid making your code complex, in place of CheckBox use HtmlInputCheckBox which will provide you both id and value fields, e.g. to add HtmlInputCheckBox to your runtime grid is as below, here on click of checkbox,
js will alert the id and value:
Dim chk As HtmlInputCheckBox
Dim i As Integer
For i = 0 To dg.Items.Count - 1 Step i + 1
chk = New HtmlInputCheckBox()
chk.ID = i.ToString()
chk.Value = "Val" + i.ToString()
chk.Attributes.Add("onclick","alert(this.id + '||' + this.value)")
dg.Items(i).Cells(1).Controls.Add(chk)
Next
Regards
Mike
Fortune favours the brave, so don't regret on missed oppurtunities.