or
<telerik:RadEditor runat="server" StripFormattingOnPaste="All" ContentAreaMode="DIV" ID="RadEditor1"> <Content> </Content></telerik:RadEditor><telerik:RadGrid ID="MyRadGrid" runat="server" AllowSorting="true" EnableHeaderContextMenu="true" Width="900px" CssClass="RadGridCustomClass"> <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder" AllowColumnHide="true" > <Resizing AllowColumnResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true" ClipCellContentOnResize="true" AllowRowResize="false" /> </ClientSettings> <HeaderContextMenu EnableRoundedCorners="true" EnableShadows="true" OnItemClick="MyRadGrid_HeaderContextMenuClick" /> <MasterTableView AllowMultiColumnSorting="false" AllowCustomSorting="true" AllowCustomPaging="true" TableLayout="Fixed" AutoGenerateColumns="false" EnableHeaderContextMenu="true" EnableViewState="false" > <Columns> <telerik:GridBoundColumn DataField="ID" SortExpression="ID" HeaderText="ID" DataType="System.Int32" /> <telerik:GridBoundColumn DataField="Name" SortExpression="Name" HeaderText="Name" DataType="System.String" /> <telerik:GridNumericColumn DataField="UnitPrice" SortExpression="UnitPrice" HeaderText="Unit price" DataType="System.Decimal" /> <telerik:GridBoundColumn DataField="Date" SortExpression="Date" DataFormatString="{0:d}" HeaderText="Date" DataType="System.DateTime" /> <telerik:GridCheckBoxColumn DataField="Discontinued" SortExpression="Discontinued" HeaderText="Discontinued" DataType="System.Boolean" /> </Columns></MasterTableView></telerik:RadGrid>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If MyRadGrid.DataSource Is Nothing Then MyRadGrid.Rebind() End IfEnd SubPrivate Sub MyRadGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles MyRadGrid.NeedDataSource Dim list2 As New List(Of MyBusinessObject)() For j As Integer = 0 To 5 Dim Product1 As New MyBusinessObject()'Some local data Product1.ID = j Product1.Name = names(j) Product1.UnitPrice = prizes(j) Product1.[Date] = dates(j) Product1.Discontinued = bools(j) list2.Add(Product1) Next MyRadGrid.DataSource = list2End SubPublic Sub MyRadGrid_HeaderContextMenuClick(ByVal sender As Object, ByVal e As RadMenuEventArgs) If e.Item.Value <> "SortAsc" And e.Item.Value <> "SortDesc" Then MyRadGrid.MasterTableView.SortExpressions.Clear() End If MyRadGrid.Rebind() 'i tried MyRadGrid.MasterTableView.Rebind()End Sub******************************Page loadPage load() data source is nothing... Calling MyRadGrid.Rebind()MyRadGrid_NeedDataSource()******************************Page loadPage load() data source is nothing... Calling MyRadGrid.Rebind()MyRadGrid_NeedDataSource()'WebDev.WebServer.EXE' (Managed): Loaded 'D:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualBasic\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.MyRadGrid_HeaderContextMenuClick() SORT EXPRESSION: Name:UnitPrice Order:Ascending
MyRadGrid_HeaderContextMenuClick() Calling MyRadGrid.Rebind()
i define a user controls inside other user control and define a
RadScriptBlock,place script code in it,but script block dont fire.please
help me.
my code is:
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript" language="javascript">
function refreshGrid(arg) {
alert("1234");
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
function RowDblClick(sender, eventArgs) {
window.radopen("Details.aspx?codemessage=" + eventArgs.getDataKeyValue("codeadvertisment"), "UserListDialog");
}
function OpenFileExplorerDialog() {
var wnd = $find("<%= ExplorerWindow.ClientID %>");
wnd.show();
}
//This function is called from the Explorer.aspx page
function OnFileSelected(wnd, fileSelected) {
var textbox = $get("<%= UploadPicture.ClientID %>");
textbox.value = fileSelected;
}
function ShowMessage(sender, args) {
var id = args.getDataKeyValue("codeadvertisment");
var wnd = window.radopen("Details.aspx?codemessage=" + id, null);
//Get the clicked row
var index = args.get_itemIndexHierarchical();
var item = args.get_tableView().get_dataItems()[index];
var rowElement = item.get_element();
//Get coordinates of the row and reposition the window relative to it
var bounds = $telerik.getBounds(rowElement);
wnd.moveTo(bounds.x + 120 + index * 10, bounds.y - 180);
}
</script>
</telerik:RadScriptBlock>