Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
124 views
Hi,
    As a newbie I'm having trouble getting started with the site map control. Just as a working example for myself, I tried to setup an ultra simple breadcrumb but I failed so I need some help. My page looks like this:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="user_Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
 
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all" DecorationZoneID="rfd-demo-zone"></telerik:RadFormDecorator>
 
        <div>
            <telerik:RadSiteMap runat="server" ID="RadSiteMap1" DataSourceID="SqlDataSource1"
                    DataFieldID="NodeNo" DataFieldParentID="ParentNodeNo"
                    DataTextField="NodeText" DataNavigateUrlField="NodeURL">
                <DefaultLevelSettings ListLayout-RepeatDirection="Horizontal" SeparatorText="/" Layout="Flow" />
            </telerik:RadSiteMap>
 
            <asp:SqlDataSource runat="server" ID="SqlDataSource1"
                ConnectionString="<%$ ConnectionStrings:RAMtrack %>"
                ProviderName="<%$ ConnectionStrings:RAMtrack.ProviderName %>"
                SelectCommand="SELECT NodeNo, ParentNodeNo, NodeText, NodeURL FROM tbl_SiteMap">
            </asp:SqlDataSource>
     
        </div>
    </form>
</body>
</html>

The table (tbl_SiteMap) in my data source looks like this:
NodeNo    ParentNodeNo    NodeText    NodeURL
1                0                         MainMenu    user/MainMenu.aspx
2                1                         Logbook       user/Logbook.aspx

When I run the page, I get this error: "This constraint cannot be enabled as not all values have corresponding parent values."
I've only got two nodes, they both have an entry for Parent Node so I can't tell what the problem is. Can you help?

Regards

Geoff

Geoff
Top achievements
Rank 1
 answered on 05 Dec 2013
4 answers
99 views
Whenever Template is used in grid data is displayed wrongly on checking the page found that the <table> ,<tr>,<td> elements are missing
If I use Inplace edit the grid is displayed correctly.





<telerik:RadGrid ID="gvCountry" runat="server" CssClass="RadGrid" GridLines="None" ShowFooter="True" ShowStatusBar="True" CellSpacing="0" VirtualItemCount="100000"

PageSize="20" AllowPaging="True" AllowCustomPaging="true" AlternatingItemStyle-BackColor="#FEE4EFFF" AutoGenerateColumns="False" AllowSorting="True"

AllowFilteringByColumn="True" OnInsertCommand="gvCountry_ItemInserted" OnUpdateCommand="gvCountry_ItemUpdated" OnDeleteCommand="gvCountry_ItemDeleted"

OnItemDataBound="gvCountry_ItemDataBound" OnItemCreated= "gvCountry_ItemCreated" OnItemCommand="gvCountry_ItemCommand" OnNeedDataSource="gvCountry_NeedDataSource"

OnDetailTableDataBind="gvCountry_DetailTableDataBind" OnGridExporting="gvCountry_GridExporting" OnExcelMLExportStylesCreated="gvCountry_ExcelMLExportStylesCreated" GroupingSettings-CaseSensitive="False">

<MasterTableView CommandItemDisplay="Top" DataKeyNames="CountryId" Name="Country" EditMode="EditForms" >

<CommandItemSettings ShowExportToExcelButton="True" ShowExportToPdfButton="True"/>

<DetailTables>

<telerik:GridTableView DataKeyNames="CityId" Name="City" CommandItemDisplay="Top" Width="100%" EditMode="EditForms" PageSize="10" VirtualItemCount="1000"

AllowPaging="True" AllowCustomPaging="true">

<EditFormSettings EditFormType="Template">

<FormTemplate>

<table id="CityEditTable" style="border-collapse: collapse; border-spacing: 0.2em; position:static;

*border-collapse: expression('separate', cellSpacing = '0.1em'); width: 100%; border: 0;">

<tbody>

<tr class="EditFormHeader">

<td colspan="4" style="font-size: small">

<b>City</b>

</td>

</tr>

<tr>

<td> <asp:Label ID="dlglblDistrict" runat="server" Text="District"></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtDistrict" runat="server" Text='<%# Bind("District") %>'></asp:TextBox> </td>

<td> <asp:Label ID="dlglblCityName" runat="server" Text="CityName"></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtCityName" runat="server" Text='<%# Bind("CityName") %>'></asp:TextBox> </td>

</tr>

<tr>

<td style="text-align: center" colspan="4">

<asp:LinkButton ID="btnUpdateDetail" runat="server" CausesValidation="true" Text="Insert" />

<asp:LinkButton ID="btnCancelDetail" CommandName="Cancel" CausesValidation="false" Text="Cancel" runat="server" />

</td>

</tr>

</tbody>

</table>

</FormTemplate>

</EditFormSettings>

<Columns>

<telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="reg_editDetail" ItemStyle-HorizontalAlign="Right" CommandName="Edit" ImageUrl="~/Content/Images/Edit.gif">

<HeaderStyle Width="2%" />

<ItemStyle HorizontalAlign="Right"></ItemStyle>

</telerik:GridButtonColumn>

<telerik:GridBoundColumn SortExpression="District" HeaderText="District" HeaderButtonType="TextButton" DataField="District" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="CityName" HeaderText="CityName" HeaderButtonType="TextButton" DataField="CityName" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" ConfirmDialogType="RadWindow"

ConfirmText="Are you sure you want to delete this registration?" ImageUrl="~/Content/Images/Delete.gif">

<HeaderStyle Width="2%" />

</telerik:GridButtonColumn>

</Columns>

</telerik:GridTableView>

</DetailTables>

<EditFormSettings EditFormType="Template" >

<FormTemplate>

<table id="MasterEditTable" style="position:static; border-collapse: collapse; border-spacing: 0.2em; *border-collapse: expression('separate', cellSpacing = '0.1em'); width: 98%;">

<tbody>

<tr class="EditFormHeader">

<td colspan="6" style="font-size: small">

<b>Country Details</b>

</td>

</tr>

<tr>

<td> <asp:Label ID="dlglblName" runat="server" Text="Name"></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox> </td>

<td> <asp:Label ID="dlglblArabicName" runat="server" Text="وطن"></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtArabicName" runat="server" Text='<%# Bind("ArabicName") %>'></asp:TextBox> </td>

<td></td><td></td>

</tr>

<tr>

<td> <asp:Label ID="dlglblNationality" runat="server" Text="Nationality"></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtNationality" runat="server" Text='<%# Bind("Nationality") %>'></asp:TextBox> </td>

<td> <asp:Label ID="dlglblArabicNationality" runat="server" Text="جنسية"></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtArabicNationality" runat="server" Text='<%# Bind("ArabicNationality") %>'></asp:TextBox> </td>

<td></td><td></td>

</tr>

<tr>

<td> <asp:Label ID="dlglblCurrencyCode" runat="server" Text="CurrencyCode" ></asp:Label> </td>

<td> <asp:TextBox ID="dltxtCurrencyCode" runat="server" Text='<%# Bind("CurrencyCode") %>'></asp:TextBox> </td>

<td> <asp:Label ID="dlglblCurrencyName" runat="server" Text="Currency" ></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtCurrencyName" runat="server" Text='<%# Bind("CurrencyName") %>'></asp:TextBox> </td>

<td> <asp:Label ID="dlglblArabicCurrencyName" runat="server" Text="عملة"></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtArabicCurrencyName" runat="server" Text='<%# Bind("ArabicCurrencyName") %>'></asp:TextBox> </td>

</tr>

<tr>

<td> <asp:Label ID="dlglblContinent" runat="server" Text="Continent" ></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtContinent" runat="server" Text='<%# Bind("Continent") %>'></asp:TextBox> </td>

<td> <asp:Label ID="dlglblRegion" runat="server" Text="Region" ></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtRegion" runat="server" Text='<%# Bind("Region") %>'></asp:TextBox> </td>

<td> <asp:Label ID="dlglblGovernmentForm" runat="server" Text="GovernmentForm"></asp:Label> </td>

<td> <asp:TextBox ID="dlgtxtGovernmentForm" runat="server" Text='<%# Bind("GovernmentForm") %>'></asp:TextBox> </td>

</tr>

<tr>

<td style="text-align: center" colspan="6">

<asp:LinkButton ID="btnUpdate" runat="server" CausesValidation="true" Text="Insert" />

<asp:LinkButton ID="btnCancel" CommandName="Cancel" CausesValidation="false" Text="Cancel" runat="server" />

</td>

</tr>

</tbody>

</table>

</FormTemplate>

</EditFormSettings>

<Columns>

<telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="reg_edit" ItemStyle-HorizontalAlign="Right" CommandName="Edit" ImageUrl="~/Content/Images/Edit.gif">

<HeaderStyle Width="2%" />

<ItemStyle HorizontalAlign="Right"></ItemStyle>

</telerik:GridButtonColumn>

<telerik:GridBoundColumn UniqueName="CountryId" HeaderText="ID" DataField="CountryId" ShowFilterIcon="false">

<HeaderStyle ForeColor="Silver" Width="20px"></HeaderStyle>

<ItemStyle ForeColor="Gray"></ItemStyle>

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="Name" HeaderText="Name" DataField="Name" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="ArabicName" HeaderText="وطن" DataField="ArabicName" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="Nationality" HeaderText="Nationality" DataField="Nationality" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="ArabicNationality" HeaderText="جنسية" DataField="ArabicNationality" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="CurrencyCode" HeaderText="Code" DataField="CurrencyCode" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="Currency" HeaderText="Currency" DataField="CurrencyName" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="ArabicCurrencyName" HeaderText="عملة" DataField="ArabicCurrencyName" AutoPostBackOnFilter="true"

CurrentFilterFunction="Contains" ShowFilterIcon="false">

</telerik:GridBoundColumn>

<telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" ConfirmDialogType="RadWindow" ImageUrl="~/Content/Images/Delete.gif"

ConfirmText="Are you sure you want to delete this registration?">

<HeaderStyle Width="2%" />

</telerik:GridButtonColumn>

<telerik:GridBoundColumn UniqueName="Continent" HeaderText="Continent" DataField="Continent" AllowFiltering="false" Visible="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="Region" HeaderText="Region" DataField="Region" AllowFiltering="false" Visible="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="GovernmentForm" HeaderText="GovernmentForm" DataField="GovernmentForm" AllowFiltering="false" Visible="false">

</telerik:GridBoundColumn>

</Columns>

<NoRecordsTemplate> <div>There are no records to display</div> </NoRecordsTemplate>

</MasterTableView>

<ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">

<Excel FileExtension="xlsx" Format="ExcelML" />

<Csv ColumnDelimiter="VerticalBar" />

</ExportSettings>

<ClientSettings>

<ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>

</ClientSettings>

</telerik:RadGrid>

Khan
Top achievements
Rank 2
 answered on 05 Dec 2013
3 answers
150 views
I'd like to check the first few bytes of a file that is being uploaded to ensure that it is actually of the type specified in its file exstension.
Is there any built-in functionality  or recommended way of doing this with a RadAsyncUpload control?
Thanks!
Plamen
Telerik team
 answered on 05 Dec 2013
4 answers
245 views
Hi

I have radpanelbar inside RadSlidingPanel. I have 2 RadPanelItem which has Itemtemplate. I want both to show as collapsed but both showing expanded when control loads. I tried ExpandMode as per demo but still no collapsible icon showing up for any radpanel item. 

<telerik:RadSlidingPane ID="RadSlidingPane2" runat="server" Width="300px" Title="Add Filters"
                MinWidth="225">
                <telerik:RadPanelBar runat="server" ExpandMode="FullExpandedItem" Width="100%" Height="150">
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="Filter By">
                            <ItemTemplate>
                          </ItemTemplate>
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Filter By SQL Criteria">
                            <ItemTemplate>
                         </ItemTemplate>
                        </telerik:RadPanelItem>
                   </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelBar>
            </telerik:RadSlidingPane>
Boyan Dimitrov
Telerik team
 answered on 05 Dec 2013
1 answer
135 views
hi i want to align the RadTab Text vertically "Middle"

<telerik:RadTabStrip ID="setupTab" CausesValidation="false"  Width="100%" Skin="" EnableEmbeddedSkins="false"
                                                        MultiPageID="setupMP" Orientation="VerticalLeft" SelectedIndex="0" runat="server">
                                                        <Tabs>
                                                            <telerik:RadTab  BackColor="#F3F0EB" ForeColor="Black" SelectedCssClass="setupTabSelected"
                                                                Height="30px" Font-Size="14px" Text="Organization Settings" Value="os">
                                                            </telerik:RadTab>
                                                            <telerik:RadTab BackColor="#F3F0EB" ForeColor="Black" SelectedCssClass="setupTabSelected"
                                                                Height="30px" Font-Size="14px" Text="Users & Groups" Value="ug">
                                                            </telerik:RadTab>
                                                        </Tabs>
                                                    </telerik:RadTabStrip>

.setupTabSelected
 {
     background-color: #FFFFFF !important;
 }
Shinu
Top achievements
Rank 2
 answered on 05 Dec 2013
1 answer
225 views
Hi There,

The issue I am having is related to these next two threads but was never really answered.

http://www.telerik.com/community/forums/aspnet-ajax/tabstrip/trying-to-understand-quot-pageviewcreated-quot-functionality.aspx

http://www.telerik.com/community/forums/aspnet-ajax/tabstrip/pageviewcreated-fires-before-tabclick.aspx

I completely understand that it is by design that the RadMultiPage PageViewCreated event fires (it seems) on every postback before Page_Load even occurs.

My problem is this:

I am building a sort of survey application that will have a dynamic number of pages (tabs)  that follows the wizard format in the Telerik online demos for the RadTabStrip. As a part of the page view creation for each page, I am loading a user control and doing an initialization routine where I dynamically load other user controls depending on the type of page that I am loading.

As a result, whenever I do a postback (e.g. a button click on a user control within a page that does a search) it takes a really long time to finish the request. I thought about doing some sort of conditional initialization of the controls to cut out some of the over head but I find the fact that PageViewCreated fires before everything else a bit difficult.

Also, if I don't fully intialise and load the controls (using LoadControl) on first page load, it seems the RadTabStrip and RadMultiPage lose state and the controls are no longer there.

Can anyone suggest an approach?

Thanks for any suggestions or input.

Kevin Parkinson
Nencho
Telerik team
 answered on 05 Dec 2013
5 answers
82 views
I am using RadTreeDropdown on a page to display hierarchical data with checkboxes with Multiple nodes selection. When I checked a parent node (let us Node1) and it has two other child nodes (Node2,Node3), then it automatically selects the child nodes, but in the dropdown text it is just showing the parent node text and not showing child node text in Chrome. It is just showing ;;;;; in place of node text.

It is working fine with other browsers.I am using Chrome latest version i.e. Version 31.0.1650.57 m.

Please help. Thanks in advance.
Boyan Dimitrov
Telerik team
 answered on 05 Dec 2013
1 answer
238 views
Hi.
I have two buttons.one to show radgrid and one to hide it. Can i hide and show radgrid on its buttonclick in clientside using javascript?
Princy
Top achievements
Rank 2
 answered on 05 Dec 2013
2 answers
71 views
i know here is not the best way to ask this, but i have a webiste and i want that when user clicks on o button it changes all telerik controls to thouch skin mode and when is not on that button switch to normal
Shinu
Top achievements
Rank 2
 answered on 05 Dec 2013
1 answer
191 views
Current Setup
I have a RadGrid and only want to provide a header context menu with an option to show/hide columns.

HeaderContextMenus are enabled and disabled grouping such that the only menu item that appears is the 'Columns' menu item which I've renamed. Please see the attached screenshot headercontextmenu_singleitem.png to get an idea of how the context menu appears when right-clicked. I have a javascript method that is applied to the client event  OnHeaderMenuShowing. This is what I'm using to rename my 'Columns' column and do some other formatting.


What I Would Like to Do
In short I would like to only show the list of columns with checkboxes to show/hide, nothing more. I am checking in the javascript OnHeaderMenuShowing to see how many items I have in my main level menu. If only 1 item I want to only show the child popout menu which lists the columns with the checkboxes to show/hide columns.

if(args.get_menu().get_items()._array.length == 1) {
    // do something here when only 1 item
}

I have managed to simulate this by setting the groupSettings offsetX and offsetY for the 'Columns' menu item to cause it to move over the main menu and setting the menu clickToOpen to true. (see screenshot headercontextmenu_singleitem_exampleonlychildshowing.png) This is more a hack and unfortunately inconsistent. After I left click on the page and right click again the menu does not appear in the same place. Multiple left clicks (on other columns) works correctly. I also cannot seem to turn off the expand and collapse animations. 

Sample for moving the child menu when 1 item:
if (items._array.length == 1) {
   items._parent.set_clickToOpen(true);
   args.get_menu().get_items().getItem(0).open();
   args.get_menu().get_items().getItem(0)._groupSettings.set_offsetX(-188); // static numbers for now
   args.get_menu().get_items().getItem(0)._groupSettings.set_offsetY(-28);
}

Sample for setting animations:
args.get_menu().get_expandAnimation().set_type("None");
args.get_menu().get_collapseAnimation().set_type("None");

Thanks in advance for any suggestions.
Princy
Top achievements
Rank 2
 answered on 05 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?