How to find rad button in RadGrid1_PreRender
Thanks Advance,
Mohamed.
<
telerik:GridTemplateColumn
SortExpression
=
"workordno1"
HeaderText
=
"Completion"
HeaderStyle-Width
=
"50px"
DataField
=
"workordno1"
FilterControlWidth
=
"60px"
UniqueName
=
"workordno1"
DataType
=
"System.Single"
>
<
ItemTemplate
>
<
telerik:RadButton
ID
=
"Work"
CommandName
=
"Redirect"
Text='<%# Eval("workordno") %>'
runat="server" OnClientClicking="StandardConfirm" Width="90px" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Thanks Advance,
Mohamed.
5 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 20 Dec 2012, 06:46 AM
Hi,
Try the following code.
C#:
Thanks,
Shinu.
Try the following code.
C#:
protected
void
RadGrid1_PreRender(
object
sender, EventArgs e)
{
foreach
(GridDataItem item
in
RadGrid2.Items)
{
RadButton btn = (RadButton)item.FindControl(
"Work"
);
}
}
Thanks,
Shinu.
0

New
Top achievements
Rank 1
answered on 20 Dec 2012, 07:09 AM
Thanks for your reply
see the picture
foreach (GridDataItem item1 in RadGrid1.Items)
{
RadButton btn = (RadButton)item1.FindControl("Work");
if (PendingSearch == "Completed")
{
item["workordno1"].Visible = true;
btn.Visible = true;
}
else
{
item["workordno1"].Visible = false;
btn.Visible = false;
}
}
see the picture
0

Shinu
Top achievements
Rank 2
answered on 21 Dec 2012, 03:49 AM
Hi,
Please try following code snippet to hide the header text also.
C#:
Thanks,
Shinu.
Please try following code snippet to hide the header text also.
C#:
protected
void
RadGrid1_PreRender(
object
sender, EventArgs e)
{
foreach
(GridDataItem item1
in
RadGrid1.Items)
{
RadButton btn = (RadButton)item1.FindControl(
"Work"
);
GridHeaderItem headerItem = (GridHeaderItem)RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0];
if
(PendingSearch ==
"Completed"
)
{
item1[
"workordno1"
].Visible =
true
;
headerItem[
"workordno1"
].Visible=
true
;
btn.Visible =
true
;
}
else
{
item1[
"workordno1"
].Visible =
false
;
headerItem[
"workordno1"
].Visible =
true
;
btn.Visible =
false
;
}
}
}
Thanks,
Shinu.
0

New
Top achievements
Rank 1
answered on 21 Dec 2012, 04:06 AM
Thanks for your reply Shinu,
I already get value like ,
GridHeaderItem item = RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
after change the your code same thing happen
Thanks Advance,
Mohamed.
I already get value like ,
GridHeaderItem item = RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
after change the your code same thing happen
Thanks Advance,
Mohamed.
0
Hello Mohamed,
Could you please elaborate on what you want to achieve? Please attach some specific screenshots along with the description which will enable us to figure out your exact requirement and provide a proper approach.
Looking forward to your reply.
Regards,
Eyup
the Telerik team
Could you please elaborate on what you want to achieve? Please attach some specific screenshots along with the description which will enable us to figure out your exact requirement and provide a proper approach.
Looking forward to your reply.
Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.