This is a migrated thread and some comments may be shown as answers.
How do I refresh this grid in oData Mode?
1 Answer 18 Views
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 2
Chris asked on 17 Nov 2010, 11:34 PM

 

 

I have a grid configured to use ADO.NET Web Services (oData) and I'd like to refresh the grid
http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx

How do I accomplish this?


<
telerik:RadGrid runat="server" ID="RadGrid2" AllowPaging="true"

 

 

 

AllowSorting="true" AllowFilteringByColumn="true"

 

 

 

AllowMultiRowSelection = "false"

 

 

 

AutoGenerateColumns="false"

 

 

 

PageSize="7"

 

 

 

HeaderStyle-HorizontalAlign ="Center"

 

 

 

GroupingSettings-CaseSensitive="false"

 

 

 

>

 

 

 

<MasterTableView DataKeyNames="Vendorkey" CommandItemDisplay="None" ClientDataKeyNames="Vendorkey">

 

 

 

<Columns>

 

<%

 

-- <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" DataType="System.Int32" />

 

<telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" DataType="System.String" />

<telerik:GridBoundColumn DataField="UnitsInStock" HeaderText="UnitsInStock" DataType="System.Int32" />

--

 

 

%>

 

 

 

<telerik:GridBoundColumn DataField="Vendorkey" Display="false" >

 

 

 

<ItemStyle Width ="150px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="VendorName" HeaderText="Name" >

 

 

 

<ItemStyle Width ="250px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="VendorGroup" HeaderText="Lawson #" />

 

 

 

<telerik:GridBoundColumn DataField="Vendor" HeaderText="Vendor #" />

 

<%

 

-- <telerik:GridBoundColumn DataField="ClassDescription" HeaderText="Class" />--%>

 

 

 

<telerik:GridBoundColumn DataField="VendorStatus" HeaderText="Status" />

 

 

 

<telerik:GridBoundColumn DataField="City" HeaderText="City" />

 

 

 

<telerik:GridBoundColumn DataField="State" HeaderText="State">

 

 

 

<ItemStyle Width="15px" />

 

 

 

</telerik:GridBoundColumn>

 

 

<%

 

-- The following is used to drive the lower grid--%>

 

 

 

<telerik:GridBoundColumn DataField="ParentID" HeaderText="ParentID" Display="false"/>

 

 

 

<telerik:GridBoundColumn DataField="ParentName" HeaderText="Parent Name" >

 

 

 

<ItemStyle Width ="250px" />

 

 

 

</telerik:GridBoundColumn>

 

<%

 

-- <telerik:GridTemplateColumn UniqueName="SourceCompanyMapColumn" HeaderText="Map" AllowFiltering="False">

 

<ItemTemplate>

<asp:ImageButton ID="imgMap" runat="server" ImageUrl="~/App_Themes/NFP/Images/grid/edit_record.png">

</asp:ImageButton>

</ItemTemplate>

</telerik:GridTemplateColumn>--

 

 

%>

 

 

 

</Columns>

 

 

 

<PagerStyle Mode="Slider" />

 

 

 

</MasterTableView>

 

 

 

<ClientSettings>

 

 

 

<Scrolling AllowScroll="False" EnableVirtualScrollPaging="True" UseStaticHeaders="True" SaveScrollPosition="True"/>

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

<ClientEvents OnRowSelected="rowSelected" OnCommand="gridTopCommand"

 

 

 

 

/>

 

 

 

<DataBinding Location="/Services/VendorDataService.svc" SelectCountMethod="GetTopCount" >

 

 

 

<DataService TableName="vDataMapperVendorTop" />

 

 

 

</DataBinding>

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

 

 

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 19 Nov 2010, 04:21 PM
Hello Chris,

You can use the following client-side code:

function RefreshGrid()
{
  var masterTable = $find("<%= RadGrid2.ClientID %>").get_masterTableView();
  masterTable.rebind();
}

All the best,
Vasil
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Chris
Top achievements
Rank 2
Answers by
Vasil
Telerik team
Share this question
or