or
| foreach (GridDataItem row in RadGrid1.MasterTableView.Items) |
| { |
| var cell = row["MyUniqueName"]; |
| Response.Write(cell.Text); // This comes out to be " " each time. |
| } |
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadGridTest.aspx.cs" Inherits="RxLink.WebForms.Testing.RadGridTest" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="scriptManager" runat="server" /> |
| <telerik:RadGrid ID="grid" runat="server" AllowPaging="true" PageSize="10" |
| Width="200px" OnNeedDataSource="grid_NeedDataSource" PagerStyle-Visible="false"> |
| <ClientSettings EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="true" /> |
| <Scrolling AllowScroll="true" EnableVirtualScrollPaging="true" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| <asp:Button ID="button" runat="server" Text="Click Me" OnClick="button_Click" /> |
| <telerik:RadTextBox ID="radTextBox" runat="server" /> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Collections.Generic; |
| namespace RxLink.WebForms.Testing |
| { |
| public partial class RadGridTest : System.Web.UI.Page |
| { |
| protected void button_Click(object sender, EventArgs e) |
| { |
| radTextBox.Text = Convert.ToString(grid.SelectedIndexes[0]); |
| } |
| protected void grid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| grid.DataSource = GetRange(); |
| } |
| static IEnumerable<int> GetRange() |
| { |
| for (int i = 0; i <= 50; i++) |
| { |
| yield return i; |
| } |
| } |
| } |
| } |
| Telerik.Web.UI.Editor.CommandList["Inhaltsverzeichnis"] = function(commandName, editor, args) |
| { |
| if (document.getElementById("toc")) { |
| alert('Es existiert bereits ein Inhaltsverzeichnis-Tag im Content-Bereich!'); |
| } |
| else { |
| editor.pasteHtml('Inhaltsverzeichnis<br /><br /><div id="toc">-Inhaltsverzeichnis-</div><br /><br />'); |
| alert('Inhaltsverzeichnis wurde erfolgreich hinzugefuegt!'); |
| } |
| }; |
| <configuration> |
| <property name="ToolbarMode">ShowOnFocus</property> |
| <property name="ToolsWidth">680px</property> |
| <property name="AllowScripts">true</property> |
| </configuration> |
| <tool name="Inhaltsverzeichnis" /> |
| Telerik.Web.UI.Editor.CommandList["Inhaltsverzeichnis"] = function(commandName, editor, args) |
| { |
| alert('test'); |
| editor.PasteHtml('Hallo!!!'); |
| }; |