Hi,
In my grid i need to set enable= false for GridEditCommandColumn,GridButtonColumn's.Here is my source code:
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditButton"
HeaderStyle-HorizontalAlign
=
"Left"
HeaderText
=
"Edit"
ItemStyle-HorizontalAlign
=
"Left"
>
<
HeaderStyle
HorizontalAlign
=
"Left"
/>
<
ItemStyle
HorizontalAlign
=
"Left"
/>
</
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
UniqueName
=
"DeleteButton"
ConfirmDialogHeight
=
"100px"
ConfirmDialogType
=
"RadWindow"
HeaderText
=
"Delete"
ConfirmDialogWidth
=
"220px"
ConfirmText
=
"Are you sure you want to delete this Indent Item?"
ConfirmTitle
=
"Delete"
HeaderStyle-HorizontalAlign
=
"Left"
HeaderStyle-VerticalAlign
=
"NotSet"
ItemStyle-HorizontalAlign
=
"Left"
>
<
HeaderStyle
HorizontalAlign
=
"Left"
/>
<
ItemStyle
HorizontalAlign
=
"Left"
/>
</
telerik:GridButtonColumn
>
I am using below code under PreRender event for the above requirement as below:
protected void gvItems_PreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in gvItems.MasterTableView.GetItems(GridItemType.Item))
{
ImageButton btn1 = (ImageButton)item.FindControl("EditButton");//accessing the Button by its name
btn1.Enabled = false;
}
}
Even though it's not working...
Can any one help me...
Thanks in advance...