Posted 25 May 2011 Link to this post
protected
void
grdEmail_ItemDataBound(
object
sender, Telerik.Web.UI.GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
GridDataItem item=(GridDataItem)e.Item;
TextBox txt = (TextBox)item.FindControl(
"TxtBox"
);
(txt.Text ==
"1"
)
//Checking for the textBox value
string
executeScript =
"<script language='javascript'>function f(){setCheckBox('"
+ e.Item.ItemIndex +
"'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>"
;
Page.ClientScript.RegisterStartupScript(
this
.GetType(),
"setCheckBox"
, executeScript );
}
function
setCheckBox(index)
var
grid = $find(
'<%=RadGrid1.ClientID %>'
masterTable = grid.get_masterTableView();
row = masterTable.get_dataItems()[index];
chkBox = row.findElement(
"CheckBox1"
chkBox.disabled =
true
<
telerik:GridTemplateColumn
>
ItemTemplate
asp:CheckBox
ID
=
runat
"server"
Checked
"true"
/>
asp:TextBox
Text='<%#Eval("EmployeeID")%>'></
</
Posted 26 May 2011 Link to this post
if (give the condition here)//Checking for the textBox value
string executeScript = "<
script
language
'javascript'
>function f(){setCheckBox('" + e.Item.ItemIndex + "'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</
>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "setCheckBox", executeScript );
Posted 27 May 2011 Link to this post
UniqueName
"ToggleButton"
DataField
"bool"
"ChkBx1"
grdEmail_ItemCreated(
sender, GridItemEventArgs e)
GridDataItem item = (GridDataItem)e.Item;
CheckBox chk = (CheckBox)item.FindControl(
chk.Attributes.Add(
"onclick"
,
"disable('"
+e.Item.ItemIndex+
"')"
//ataching the click event to the checkBox and passing the index
disable(index)
masterTable = $find(
"<%= RadGrid1.ClientID %>"
).get_masterTableView();
chk1 = row.findElement(
chk2 = row.findElement(
(chk1.checked)
chk2.disabled =
else
false