Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
90 views
Sir ,
I have a radgrid for selfhierarchy. All child items are displayed.
 BUt the child item is also repeated as parent item.
How ican avoid the repeation in radgrid.
Pls help.
ex.

    Empid
      1    parent item
       ------2     child item
       ------3    child item
  5   parent item
  6   parent item
  2    parent item( it is a child item repeated)
  3  parent item( it is a child item repeated)

By jessy

Andrey
Telerik team
 answered on 28 Sep 2012
1 answer
80 views
Sir,

 I have a radtreelist.i try to bind the treelist by my dataset.  But i cannot  bind in a hieracical mode.
child record is existing .


Pls help me.


by Jessy
Andrey
Telerik team
 answered on 28 Sep 2012
2 answers
171 views
I am having a problem with the TreeList.  I am able to populate the list with parent and children elements.  I can update and delete just fine.  I can also Insert a new child element just fine.  However when I try to insert a root level element with debugging enabled I have not been able to get the InsertCommand to fire.  I am also using a user control for the editor.  Here is my code as it is. 

.aspx Page:

<div id="DropUnderWrapper">
    <asp:CheckBox ID="IsUnder" runat="server" Text=" Drop Under Parent" />
</div>
<telerik:RadTreeList ID="MenuManager" runat="server">
    <Columns>
        <telerik:TreeListBoundColumn DataField="MenuText" HeaderText="Menu Name" UniqueName="Name" />
        <telerik:TreeListHyperLinkColumn DataNavigateUrlFields="SitePageID" DataNavigateUrlFormatString="/admin/pageManager/?CID={0}" DataTextField="PageTitle" HeaderText="Url Title" UniqueName="PageTitle"  />
        <telerik:TreeListBoundColumn DataField="MenuUrl" HeaderText="Url" UniqueName="MenuUrl" />
        <telerik:TreeListBoundColumn DataField="MenuTarget" HeaderText="Target" UniqueName="MenuTarget" HeaderStyle-Width="60px" />
        <telerik:TreeListBoundColumn DataField="IsEnabled" HeaderText="Status" UniqueName="MenuItemEnabled" HeaderStyle-Width="60px" />
        <telerik:TreeListEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="60px" AddRecordText="Add Menu Item" Reorderable="false" />
        <telerik:TreeListButtonColumn ButtonType="ImageButton" ButtonCssClass="deleteConfirm" CommandName="Delete" HeaderStyle-Width="30px" />
    </Columns>
    <EditFormSettings UserControlPath="~/includes/userControls/MenuForm.ascx" EditFormType="WebUserControl">
    </EditFormSettings>
    <ClientSettings AllowItemsDragDrop="true">
        <Selecting AllowItemSelection="True" />
    </ClientSettings>
</telerik:RadTreeList>

Code Behind:

private string[] DataKey = { "MenuID" };
private string[] ParentKey = { "ParentID" };
private List<SiteMenu> MenuList = new List<SiteMenu>();
 
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    MenuManager.Skin = "Default";
    MenuManager.AllowPaging = false;
    MenuManager.AutoGenerateColumns = false;
    MenuManager.GridLines = TreeListGridLines.Both;
    MenuManager.ShowTreeLines = false;
    MenuManager.NeedDataSource += MenuManager_NeedDataSource;
    MenuManager.InsertCommand += MenuManager_InsertCommand;
    MenuManager.UpdateCommand += MenuManager_UpdateCommand;
    MenuManager.DeleteCommand += MenuManager_DeleteCommand;
    MenuManager.ItemDataBound += MenuManager_ItemDataBound;
    MenuManager.ItemCommand += MenuManager_ItemCommand;
    MenuManager.ClientSettings.AllowItemsDragDrop = true;
    MenuManager.ClientSettings.Selecting.AllowItemSelection = true;
    MenuManager.AllowMultiItemSelection = true;
    MenuManager.DataKeyNames = DataKey;
    MenuManager.ParentDataKeyNames = ParentKey;
    MenuManager.ItemDrop += MenuManager_RowDrop;
 
    MenuList = new SiteMenu().SelectAllPublicMenuItemsBySiteIDNotDeleted(ThisSiteID);
}
 
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    if (!IsPostBack)
    {
        MenuManager.ExpandToLevel(1);
    }
}
 
protected void MenuManager_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e)
{
    MenuManager.DataSource = MenuList;
}
 
protected void MenuManager_ItemCommand(object sender, TreeListCommandEventArgs e)
{
    if (e.CommandName == RadTreeList.InitInsertCommandName)
    {
        MenuManager.ClientSettings.Reordering.AllowColumnsReorder = false;
    }
    if (e.CommandName == RadTreeList.CancelCommandName)
    {
        MenuManager.ClientSettings.Reordering.AllowColumnsReorder = true;
    }
}
 
protected void MenuManager_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
{
   //irrelevant
}
 
protected void MenuManager_InsertCommand(object sender, TreeListCommandEventArgs e)
{
    TreeListEditFormItem item = e.Item as TreeListEditFormItem;
    UserControl MenuForm = (UserControl)e.Item.FindControl(TreeListEditFormItem.EditFormUserControlID);
 
    int parentID = (int)item.ParentItem.GetDataKeyValue("MenuID");
 
    RadComboBox menuType = (RadComboBox)MenuForm.FindControl("MenuSelectList");
    RadTextBox menuText = (RadTextBox)MenuForm.FindControl("MenuText");
    switch (menuType.SelectedItem.Text)
    {
        case "Editable Content":
            RadTextBox pageTitle = (RadTextBox)MenuForm.FindControl("PageTitle");
            CheckBox defaultHomepage = (CheckBox)MenuForm.FindControl("DefaultHomepage");
            if (new SiteMenu().InsertNewMenuItem(parentID, menuText.Text, pageTitle.Text, defaultHomepage.Checked))
            {
                Response.Redirect("/admin/menuManager/");
            }
            break;
        case "Document Link":
            UploadedFile uploadedFile = null;
            RadUpload docUpload = (RadUpload)MenuForm.FindControl("DocumentLink");
            if (docUpload.UploadedFiles.Count > 0)
            {
                uploadedFile = docUpload.UploadedFiles[0];
            }
            if (new SiteMenu().InsertNewDocumentLink(parentID, menuText.Text, uploadedFile.GetName()))
            {
                Response.Redirect("/admin/menuManager/");
            }
            break;
        case "External / Custom Link":
            RadTextBox linkUrl = (RadTextBox)MenuForm.FindControl("LinkUrl");
            RadComboBox target = (RadComboBox)MenuForm.FindControl("LinkTarget");
            if (new SiteMenu().InsertExternalLink(parentID, menuText.Text, linkUrl.Text, target.Text))
            {
                Response.Redirect("/admin/menuManager/");
            }
            break;
        case "Chamber Modules":
            RadComboBox moduleType = (RadComboBox)MenuForm.FindControl("ModulePageType");
            if (new SiteMenu().InsertNewModuleMenuItem(parentID, menuText.Text, moduleType.SelectedValue))
            {
                Response.Redirect("/admin/menuManager/");
            }
            break;
    }
}
 
protected void MenuManager_UpdateCommand(object sender, TreeListCommandEventArgs e)
{
      //irrelevant
}
 
protected void MenuManager_DeleteCommand(object sender, TreeListCommandEventArgs e)
{
      //irrelevant
}
 
protected void MenuManager_RowDrop(object sender, TreeListItemDragDropEventArgs e)
{
    int key = (int)e.DraggedItems[0].GetDataKeyValue("MenuID");
 
    int destinationId = 0;
    int sortOrder = 0;
 
    if (IsUnder.Checked)
    {
        destinationId = (int)e.DestinationDataItem.GetDataKeyValue("MenuID");
        sortOrder = 1;
    }
    else
    {
        destinationId = (int)e.DestinationDataItem.GetParentDataKeyValue("ParentID");
        sortOrder = new SiteMenu().SelectThisMenuItem((int)e.DestinationDataItem.GetDataKeyValue("MenuID"), ThisSiteID).SortOrder + 1;
    }
 
    if (destinationId == 0)
    {
        if (key != destinationId)
        {
            MenuList.FirstOrDefault(i => i.MenuID == key).ParentID = destinationId;
            MenuList.FirstOrDefault(i => i.MenuID == key).SortOrder = sortOrder;
 
            foreach (SiteMenu menuItem in MenuList.Where(i => i.ParentID == destinationId))
            {
                if (menuItem.SortOrder >= sortOrder && menuItem.MenuID != key)
                {
                    menuItem.SortOrder += 1;
                }
            }
 
            if (new SiteMenu().UpdateMenuListByParentID(destinationId, MenuList.Where(i => i.ParentID == destinationId).ToList()))
            {
                Response.Redirect("/admin/menuManager/");
            }
        }
    }
    else
    {
        if (key != destinationId && key != MenuList.FirstOrDefault(i => i.MenuID == destinationId).ParentID)
        {
            MenuList.FirstOrDefault(i => i.MenuID == key).ParentID = destinationId;
            MenuList.FirstOrDefault(i => i.MenuID == key).SortOrder = sortOrder;
 
            foreach (SiteMenu menuItem in MenuList.Where(i => i.ParentID == destinationId))
            {
                if (menuItem.SortOrder >= sortOrder && menuItem.MenuID != key)
                {
                    menuItem.SortOrder += 1;
                }
            }
 
            if (new SiteMenu().UpdateMenuListByParentID(destinationId, MenuList.Where(i => i.ParentID == destinationId).ToList()))
            {
                Response.Redirect("/admin/menuManager/");
            }
        }
    }
}
Kevin
Top achievements
Rank 1
 answered on 28 Sep 2012
1 answer
155 views
hii,
I want to Prevent a specific button in RadToolBar from performing postback.How can I achieve this?

regards
Princy
Top achievements
Rank 2
 answered on 28 Sep 2012
1 answer
302 views
HII,
  I have a RadButton which is a StandardButton. I also attached the NavigateUrl property of RadButton. But on clicking on the RadButton it is not navigating to the url specified. Why the NavigateUrl is not working?

thankss
Princy
Top achievements
Rank 2
 answered on 28 Sep 2012
1 answer
149 views
hii,
want to adda textbox to every uploaded files in a RadAsyncUpload to enter some additional info. Can anybody please help me to achieve this scenario.


thanks.....
Princy
Top achievements
Rank 2
 answered on 28 Sep 2012
1 answer
424 views
Hi all,

In my grid, I don't want the user to add records while editing. Is there a way to disable the add new record button in edit mode?
Thanks in advance.


Shinu
Top achievements
Rank 2
 answered on 28 Sep 2012
2 answers
124 views
Hi all,

In my page I have a RadGrid.In this, I need to hide the first row. How can I do that?
Please provide some solutions.

Thanks in advance.
Janaki
Top achievements
Rank 1
 answered on 28 Sep 2012
2 answers
130 views
According to the documentation here http://www.telerik.com/help/aspnet-ajax/introduction-jquery-intellisense.html I do not need to do anything special to get JQuery intellisense to work on my page.

I have the following in my form:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            window.$ = $telerik.$;
             
            //$("tr.Graph").click(function () {
            //    $(this).nextAll("tr").fadeToggle(500);
            //}).eq(0).trigger('click');
        </script>


Whenever I enter $ or $., I do not get any intellisense. I am using Visual Studio 2012. Could that be an issue? 
DuelingCats
Top achievements
Rank 2
 answered on 28 Sep 2012
1 answer
82 views
Dear
i have some issue with Export data from grid to PDF file & CSV file
with PDF: when i export date it come all data not formatted and all data come above some
and it is look like that

================================================
and about CSV file
it is come with Birth date only and all another fields is empty without any data

my code look like
(ASP):
                     <telerik:RadButton ID="RadBtn_ExportPDF" runat="server" Text="ExportPDF"
                        onclick="RadBtn_ExportPDF_Click" >
                    </telerik:RadButton>
                     <telerik:RadButton ID="RadBtn_ExportExcel" runat="server" Text="ExportExcel"
                         onclick="RadBtn_ExportExcel_Click">
                    </telerik:RadButton>
                    <telerik:RadButton ID="RadBtn_ExportCSV" runat="server" Text="ExportSCV"
                        onclick="RadBtn_ExportCSV_Click">
                    </telerik:RadButton>

and in (CS):
protected void RadBtn_ExportPDF_Click(object sender, EventArgs e)
    {
        ConfigureExport();
        MainGride.MasterTableView.ExportToPdf();
    }

    protected void RadBtn_ExportExcel_Click(object sender, EventArgs e)
    {
        ConfigureExport();
        MainGride.MasterTableView.ExportToExcel();
    }

    protected void RadBtn_ExportCSV_Click(object sender, EventArgs e)
    {
        ConfigureExport();
        MainGride.MasterTableView.ExportToCSV();
    }

    public void ConfigureExport()
    {
        MainGride.ExportSettings.ExportOnlyData = true;
        MainGride.ExportSettings.IgnorePaging =true;
    }
and in item command :

if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName ||
            e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName ||
            e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName )
        {
            ConfigureExport();
        }
i need to your help in that to make data formatted well in Export PDF and to get all data in Export CSV file

Regard
Ahmed Salem
Jayesh Goyani
Top achievements
Rank 2
 answered on 27 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?