<
telerik:RadGrid ID="grdDealerList" runat="server"
AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="10" ShowStatusBar="true" OnItemCommand="RadGrid1_ItemCommand" >
<PagerStyle Mode="NumericPages" />
<MasterTableView Width="100%" >
<Columns>
<telerik:GridButtonColumn DataTextField="DEALER_NUM" CommandArgument="DEALER_NUM" HeaderText="Dealer Number" CommandName="Select">
</telerik:GridButtonColumn>
<telerik:GridHyperLinkColumn
DataNavigateUrlFields= "DEALER_NUM,ROW_ID"
DataNavigateUrlFormatString= "~/Details.aspx?DealerNum={0}&RowID={1}" DataTextField="DEALER_NUM">
</telerik:GridHyperLinkColumn>
</Columns>
</MasterTableView>
<ClientSettings EnablePostBackOnRowClick="true" >
<Selecting AllowRowSelect="True" ></Selecting>
</ClientSettings>
</telerik:RadGrid>
| Tree.aspx |
| <telerik:RadTreeView ID="RadTreeView1" runat="server" AllowNodeEditing="True" |
| BorderColor="Black" EnableDragAndDrop="True" |
| OnNodeDrop="RadTreeView1_NodeDrop" |
| Skin="Telerik" |
| BorderStyle="Solid" BorderWidth="1px" Height="200px" |
| MultipleSelect="True" onnodeclick="RadTreeView1_NodeClick" Width="280px"> |
| <DataBindings> |
| <telerik:RadTreeNodeBinding |
| ImageUrlField="ImageUrlType" |
| /> |
| </DataBindings> |
| .... |
| Tree.aspx.cs: |
| List<TreeNode> myTreeNodes = new List<TreeNode>(); |
| ... |
| RadTreeView1.DataSource = new HierarchicalModelDataSource<TreeNode> { DataSource = myTreeNodes }; |
| RadTreeView1.DataBind(); |
| RadTreeView1.CollapseAllNodes(); |
| TreeNode.cs: |
| public class TreeNode : IModelWithHierarchy<TreeNode> |
| { |
| CoreData _coreData; |
| public CoreData CoreDataItem |
| { |
| get { return _coreData; } |
| set { _coreData = value; } |
| } |
| public TreeNode Parent { get; set; } |
| public List<TreeNode> Children { get; set; } |
| public string Name |
| { |
| get |
| { |
| return _coreData.Name; |
| } |
| set |
| { |
| ; |
| } |
| } |
| public string ImageUrlType |
| { |
| get |
| { |
| String directoryImageUrl = "Images/folder.gif"; |
| String fileImageUrl = "Images/image.png"; |
| if (_coreData.IsDirectory) |
| { |
| return directoryImageUrl; |
| } |
| else if (_coreData.IsFile) |
| { |
| return fileImageUrl; |
| } |
| } |
| } |
| } |
<%
@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%
@ register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!
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></title>
<link id="Link1" href="~/MySkin/Input.MySkin.css" rel="stylesheet" type="text/css" runat="server" />
</head>
<body>
<form id="form1" runat="server">
<div><asp:scriptmanager id="ScriptManager1" runat="server" />
<telerik:radtextbox id="RadTextBox1" runat="server" Skin="MySkin" EnableEmbeddedSkins="False" ></telerik:radtextbox>
</div>
</form>
</body>
</html>

| <table> |
| <thead> |
| <tr> |
| <th width="50%">Types of Enquiry</th> |
| <th width="20%"> Tel Number</th> |
| <th width="30%">Email Address </th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td><strong>Mount Faber Club</strong> - Activities, facilities and rates</td> |
| <td>6278 6011</td> |
| <td><a href="mailto:mtfaberclub@safra.sg">mtfaberclub@safra.sg</a></td> |
| </tr> |
| <tr> |
| <td><strong>Toa Payoh Club</strong> - Activities, facilities and rates </td> |
| <td>6259 4000</td> |
| <td><a href="mailto:tpclub@safra.sg">tpclub@safra.sg</a> </td> |
| </tr> |
| <tr> |
| <td><strong>Tampines Club</strong> - Activities, facilities and rates</td> |
| <td>6785 8800</td> |
| <td><a href="mailto:tmclub@safra.sg">tmclub@safra.sg</a> </td> |
| </tr> |
| </tbody> |
| </table> |
| <br /> |
| <table bordercolor="#666666" border="1"> |
| <thead> |
| <tr> |
| <th width="50%">Types of Enquiry</th> |
| <th width="20%"> Tel Number</th> |
| <th width="30%">Email Address </th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <th><strong>Mount Faber Club</strong> - Activities, facilities and rates</th> |
| <th>6278 6011</th> |
| <th><a href="mailto:mtfaberclub@safra.sg">mtfaberclub@safra.sg</a></th> |
| </tr> |
| <tr> |
| <th><strong>Toa Payoh Club</strong> - Activities, facilities and rates </th> |
| <th>6259 4000</th> |
| <th><a href="mailto:tpclub@safra.sg">tpclub@safra.sg</a> </th> |
| </tr> |
| <tr> |
| <th><strong>Tampines Club</strong> - Activities, facilities and rates</th> |
| <th>6785 8800</th> |
| <th><a href="mailto:tmclub@safra.sg">tmclub@safra.sg</a> </th> |
| </tr> |
| </tbody> |
| </table> |
| <br /> |
This code will throw an exception:
| GridDataItem dItem = e.Item as GridDataItem; |
| // rename edit button |
| TableCell cell = dItem["cmdEdit"]; |
| if (cell != null) |
| { |
| Control control = cell.Controls[0]; |
| if (control != null) |
| { |
| LinkButton cmdEdit = control as LinkButton; |
| cmdEdit.Text = "View"; |
| } |
| } |
Instead of handling exceptions, I would rather prefer to check if the column exists prior to accessing it. I couldn't find any simple way of checking column existense by unique name.
Why don't you introduce a method GridDataItem.ContainsColumn(uniqueName) ?
<asp:Panel ID="Panel6" runat="server" Height="95%" Width="100%">
<telerik:RadToolBar ID="RadSmallToolBar1" runat="server" Skin="Office2007" Width="650px" OnButtonClick="RadSmallToolBar1_Click" >
<Items>
<telerik:RadToolBarButton runat="server" PostBack="true" ImagePosition="Left" CausesValidation="false" DisabledImageUrl="~/Images/16x16/Save.gif" ImageUrl="~/Images/16x16/Save.gif" Value="Submit" Text="Save"></telerik:RadToolBarButton>
</Items>
</telerik:RadToolBar>
</asp:Panel>
Notecontrol.ascx.csprotected void RadSmallToolBar1_Click(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
{.....................
}
masterpage.aspx<radts:PageView ID="Page05" runat="server">
<asp:Panel ID="Panel6" runat="server">
<div style="background: url(../../Images/bg.jpg) no-repeat;">
<div class="Header">
Notes:
</div>
</div>
<div style="padding-bottom: 0.25in">
<rad:RadAjaxPanel ID="NotesAjaxPanel" runat="server" EnableAJAX="true">
<asp:Panel ID="NotesLoadingPanel" runat="server" Width="100%">
</asp:Panel>
</rad:RadAjaxPanel>
</div>
</asp:Panel>
private void GetNotes()
{
Control notes = this.LoadControl("~/FormContainers/NotesControl.ascx");
this.NotesLoadingPanel.Controls.Add(notes);
}
i tested with asp button and it is firing the clickevent but when i replace with toolbar the event is not firing.
Thanks
Baqi