Hello,
I have a Ajaxified Grid that populates a sub grid using the OnRowSelected ClientEvent. It also opens a modal edit control with Javascript. This MasterRadGrid is rather large and takes a couple of seconds to load. The OnRowSelected even calls the rowSelected function.
Which calls the RaisePostBackEvent...
Which fires the CommandEvent for select...
My issue is that every time the row is selected, it raises a postback event that reloads the MasterRadGrid, whether the data needs refreshed or not. I'm stumped on how to raise the postback event to load the child grid but prevent the MasterRadGrid from reloading. Any ideas on what I'm missing or a direction you can point me in?
Thanks for taking a look.
Smith
I have a Ajaxified Grid that populates a sub grid using the OnRowSelected ClientEvent. It also opens a modal edit control with Javascript. This MasterRadGrid is rather large and takes a couple of seconds to load. The OnRowSelected even calls the rowSelected function.
function
rowSelected(senders, args) {
var
ajaxManager = $find(
'<%= RadAjaxManager1.ClientID %>'
);
var
selectedIndex = args.get_itemIndexHierarchical();
ajaxManager.ajaxRequestWithTarget(
'<%= MasterRadGrid.UniqueID %>'
, selectedIndex);
}
Which calls the RaisePostBackEvent...
protected
override
void
RaisePostBackEvent(IPostBackEventHandler sourceControl,
string
eventArgument)
{
try
{
viewstateColumnSequence = 0;
base
.RaisePostBackEvent(sourceControl, eventArgument);
var grid = sourceControl
as
RadGrid;
if
(grid !=
null
)
{
try
{
var gridItem = grid.Items[eventArgument];
gridItem.FireCommandEvent(RadGrid.SelectCommandName, String.Empty);
}
catch
{ }
}
}
catch
(Exception ex)
{
}
}
Which fires the CommandEvent for select...
protected
void
MasterRadGrid_ItemCommand(
object
source, Telerik.Web.UI.GridCommandEventArgs e)
{
//Needed to reset the column created column names
viewstateColumnSequence = 0;
try
{
if
(e.Item !=
null
&& e.Item.ItemIndex >= 0)
{
if
(e.CommandName ==
"Select"
)
{
string
tempCiIdHidden = ChildTabControl.myCiIdHidden.Value;
HiddenField myCiIdHidden = (HiddenField)e.Item.FindControl(
"CiIdHidden"
);
if
(tempCiIdHidden != myCiIdHidden.Value)
{
LoadChildGrid(myCiIdHidden.Value);
}
//Needed to persist the custom column template changes
MasterRadGrid.Rebind();
}
}
}
catch
(Exception ex)
{
}
}
My issue is that every time the row is selected, it raises a postback event that reloads the MasterRadGrid, whether the data needs refreshed or not. I'm stumped on how to raise the postback event to load the child grid but prevent the MasterRadGrid from reloading. Any ideas on what I'm missing or a direction you can point me in?
Thanks for taking a look.
Smith