I have a RadGrid that displays the results of a query submitted by the user. If the user requeries I want the vertical scroll position to be at the top of the grid, not at the position of the previous query. How do I do this?
I have tried the following in the PreRender event all to no avail:
RadGrid1.MasterTableView.CurrentPageIndex = 0;
and this..
if (RadGrid1.MasterTableView.Items.Count > 0)
{
RadGrid1.MasterTableView.Items[0].Selected = true;
}
Here are my property settings
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" Width="100%"
Height="450px" ShowStatusBar="True"
AutoGenerateColumns="False" CellSpacing="0" GridLines="None"
onprerender="RadGrid1_PreRender"
onitemdatabound="RadGrid1_ItemDataBound"
ondetailtabledatabind="RadGrid1_DetailTableDataBind"
onneeddatasource="RadGrid1_NeedDataSource"
OnItemCreated="RadGrid1_ItemCreated"
onsortcommand="RadGrid1_SortCommand">
<MasterTableView DataKeyNames="GloveId, MaterialType, Chemical" HierarchyDefaultExpanded="true" Name="PermDataGroup" CssClass="masterTablePadding"
GroupsDefaultExpanded="False" >
Thanks,
Rob
I have tried the following in the PreRender event all to no avail:
RadGrid1.MasterTableView.CurrentPageIndex = 0;
if (RadGrid1.MasterTableView.Items.Count > 0)
{
RadGrid1.MasterTableView.Items[0].Selected = true;
}
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" Width="100%"
Height="450px" ShowStatusBar="True"
AutoGenerateColumns="False" CellSpacing="0" GridLines="None"
onprerender="RadGrid1_PreRender"
onitemdatabound="RadGrid1_ItemDataBound"
ondetailtabledatabind="RadGrid1_DetailTableDataBind"
onneeddatasource="RadGrid1_NeedDataSource"
OnItemCreated="RadGrid1_ItemCreated"
onsortcommand="RadGrid1_SortCommand">
<MasterTableView DataKeyNames="GloveId, MaterialType, Chemical" HierarchyDefaultExpanded="true" Name="PermDataGroup" CssClass="masterTablePadding"
GroupsDefaultExpanded="False" >
Thanks,
Rob