This question is locked. New answers and comments are not allowed.
Here
is
the scenario. I have radgrid which has a Gridbutton
as
one of the
colum.When the user click on that button i redirect them to a different page
for
editing. It works fine since i trap the ItemCommand
event
. But I am wondering
is
there a way I cab
get
the Control/Id of the control which caused the
postback
in
the Page Load rather than the ItemCommand
event
so that way I
can skip some of the page_life cycle methods and straight take them to the edit
page. I am not able to
do
this
if
the user clicks a regular button whcih
is
part
of the page. but I am not able to
get
the control/controlid which
is
inside the
radgrid which caused the postback. Appreciate any help.
Here is my grid definition
<telerik:RadGrid
ID="rdgAccountView"
runat="server"
AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False"
OnNeedDataSource="rdgAccountView_OnNeedDataSource"
OnItemCreated="rdgAccountView_ItemCreated"
OnItemCommand="rdgAccountView_ItemCommand"
OnPreRender="rdgAccountView_PreRender"
OnLoad="rdgAccountView_OnLoad"
OnItemDataBound="rdgAccountView_ItemDataBound"
>
<ClientSettings>
<Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="320"/>
<Selecting AllowRowSelect="False" />
<Resizing AllowColumnResize="true" ClipCellContentOnResize="true" />
</ClientSettings>
<ExportSettings>
<Pdf FontType="Subset" PaperSize="Letter" />
<Excel Format="Html" />
</ExportSettings>
<MasterTableView
Width="100%"
NoDetailRecordsText="No Account Records Found"
CurrentResetPageIndexAction="SetPageIndexToFirst"
Dir="LTR"
Frame="Border"
TableLayout="Auto"
DataKeyNames="ParentIdentifier">
<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<Columns>
<telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../../App_Themes/Default/DataEditingImages/Edit.gif"
CommandName="EditAccountView" Text="Edit" UniqueName="EditFromAccountView">
<HeaderStyle Width="20px" />
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="FirstName" Groupable="False" HeaderText="First Name"
UniqueName="Work Queue" ReadOnly="True" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
HeaderStyle-Width="100px" HeaderStyle-Wrap="true" AutoPostBackOnFilter="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LastName" Groupable="False" HeaderText="Last Name"
UniqueName="Work Queue" ReadOnly="True" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
HeaderStyle-Width="100px" HeaderStyle-Wrap="true" AutoPostBackOnFilter="true">
</telerik:GridBoundColumn>
<telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this Account?"
ButtonType="ImageButton" Visible="True" ImageUrl="../../App_Themes/Default/DataEditingImages/Delete.gif"
CommandName="DeleteAccount" Text="Delete" UniqueName="DeleteAccountColumn">
<HeaderStyle Width="20px" />
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings>
<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
</EditColumn>
<PopUpSettings ScrollBars="None"></PopUpSettings>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowColumnsReorder="True">
</ClientSettings>
</telerik:RadGrid>