Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
314 views

Hi I have a RadMenu that I am populating dynamically through the code behind.  I need to add checkboxes to each child item that allows the user to make a selection or multiple selections in the menu.  Is it possible to do this?  Someone had suggested to me that I try and nest a RadComboBox inside of the RadMenu, but I'm having no luck with that.  I will paste my code below if it will help.

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <telerik:RadMenu ID="handsetMenu" runat="server">   
                        <Items>    
                                                
                        </Items>                                           
                    </telerik:RadMenu>
                    </ContentTemplate>
                </asp:UpdatePanel> 

 

Code Behind:

 

protected void createFilter(int categoryid)
    {
        List<int> productIds = new List<int>();
        DataRow[] productRow = CategoriesProductsData.Tables["Products"].Select("Category_ID = " + 573);

        productIds = productRow.Select(p => int.Parse(p["Product_ID"].ToString())).ToList();

        ITCProductService pService = new TCProductServiceClient();
        var productTuples = (pService.GetProductsAttributes(productIds));

        List<Tuple<int, CustomAttribute>> customAttributes = new List<Tuple<int, CustomAttribute>>();
        foreach (var productTuple in productTuples)
        {
            foreach (var attributeTuple in productTuple.m_Item2)
            {
                var customAttribute = new Tuple<int, CustomAttribute>(productTuple.m_Item1, new CustomAttribute(attributeTuple));
                customAttributes.Add(customAttribute);
            }

        }

        List<CustomAttributeCategory> categories = new List<CustomAttributeCategory>();

        var categoryList = customAttributes.Select(a => a.Item2).Select(a => a.Attribute.Category).GroupBy(a => a.AttributeCategoryId);

        var CatProdList = new List<CustomAttributeCategory>();

        foreach (var category in categoryList)
        {
            var CatProd = new CustomAttributeCategory();

            var prodIDList = from product in customAttributes
                             where product.Item2.Attribute.CategoryId == category.Key
                             select Tuple.Create(product.Item1, product.Item2);

            CatProd.Category = customAttributes.Select(a => a.Item2.Attribute.Category).Where(a => a.AttributeCategoryId == category.Key).FirstOrDefault();
            CatProd.ProdAttributesTuple = new List<Tuple<int, CustomAttribute>>();
            CatProd.ProdAttributesTuple = prodIDList.ToList();

            CatProdList.Add(CatProd);
        }

        foreach (var cat in CatProdList)
        {
            var itemCategory = new RadMenuItem(cat.Category.Name);
            
            handsetMenu.Items.Add(itemCategory);
            

            var option = cat.ProdAttributesTuple.GroupBy(a => a.Item2.Attribute.Value).ToList();
            foreach (var attr in option)
            {
                itemCategory.Items.Add(new RadMenuItem(attr.Key));              
                

            }
        }

    }


    protected void handsetMenu_ItemDataBound(object sender, RadMenuEventArgs e)
    {
        DataRowView row = (DataRowView)e.Item.DataItem;

    }


    public class CustomAttributeCategory
    {
        public AttributeCategoryModel Category { get; set; }
        public List<Tuple<int, CustomAttribute>> ProdAttributesTuple { get; set; }
    }

    public class CustomAttribute
    {
        public AttributeModel Attribute { get; set; }

        public List<int> ProductIds { get; set; }

        public CustomAttribute(AttributeModel attribute)
        {
            Attribute = attribute;
            ProductIds = new List<int>();
        }
    }​

Aneliya Petkova
Telerik team
 answered on 26 Aug 2015
3 answers
236 views

I'm trying to build this functionality into my website. In Telerik's demo the progress bar is inside the tooltip and it moves around to each element when an element is clicked on. How do I do this?

Am I correct to assume it is one tooltip and one progressbar and the TargetId of the tooltip is changed to the element that was clicked on with client side programming? Could I have an example of the client side programming? I am new to Telerik and Jquery as of this week, but I am a solid programmer of many years, some how just never got to JQuery.

Vessy
Telerik team
 answered on 26 Aug 2015
2 answers
98 views

Hello,

I am using two nested grid inside main radgrid ,its working fine when expand the nested grid but when  collapse event fire then main grid disappear

i am not identified how to handle its on Pre_render or itemCommand event below is my Code

 

   <telerik:RadGrid ID="gvJobDeatail" runat="server" GridLines="None" AutoGenerateColumns="false"
                            AllowPaging="true" AllowSorting="true" AllowAutomaticUpdates="true" ShowStatusBar="true"
                            PageSize="5" OnNeedDataSource="BindDataGrid_OnNeedDataSource" OnItemCommand="gvJobDetails_onItemCommand"
                            OnPreRender="gvJobDetails_PreRender" OnItemCreated="RadGrid_ItemCreated">
                            <%--OnItemCreated="gvJobDetails_ItemCreatd">--%>
                            <PagerStyle Mode="NextPrevAndNumeric" />
                            <MasterTableView DataKeyNames="INSTANCEID" ShowFooter="true" TableLayout="Fixed">
                                <Columns>
                                    <telerik:GridBoundColumn SortExpression="INSTANCEID" DataField="INSTANCEID" HeaderText="Instance Id">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="JOBNAME" DataField="JOBNAME" HeaderText="Job Name">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="STRATTIME" DataField="STRATTIME" HeaderText="Start Date and Time">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="ENDTIME" DataField="ENDTIME" HeaderText="End Date and Time">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="STATUS" DataField="STATUS" HeaderText="Status">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <NestedViewTemplate>
                                    <asp:Panel ID="pnlDetails" runat="server" Visible="false">
                                        <table width="50%">
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblFormatted" runat="server" Text="File Detail:For Formatted Offload type"
                                                        CssClass="normalbold"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <telerik:RadGrid ID="gvInstanceDetails" runat="server" AllowPaging="true" ShowStatusBar="true"
                                                        Width="1050px" Height="250px" AutoGenerateColumns="False" AutoExpandGroups="false"
                                                        PageSize="5" AllowMultiRowSelection="false" GridLines="None" AllowSorting="true"
                                                        OnNeedDataSource="gvInstanceDetails_NeedDataSource">
                                                        <%--  >--%>
                                                        <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="" />
                                                        <MasterTableView AllowMultiColumnSorting="True">
                                                            <Columns>
                                                                <telerik:GridBoundColumn DataField="FileRaeted" HeaderText="Files Rated" SortExpression="FileRaeted">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="ip" HeaderText="Files in FTP " SortExpression="ip">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="FileFailure" HeaderText="Files re-tried sending to FTP"
                                                                    SortExpression="FileFailure">
                                                                </telerik:GridBoundColumn>
                                                            </Columns>
                                                        </MasterTableView>
                                                        <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">
                                                            <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
                                                            <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="" />
                                                        </ClientSettings>
                                                    </telerik:RadGrid>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                    <asp:Panel ID="pnlRawDetail" runat="server" Visible="false">
                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblRaw" runat="server" Text="File Detail:For Raw Offload type" CssClass="normalbold"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <telerik:RadGrid ID="gvRawDetails" runat="server" AllowPaging="true" ShowStatusBar="true"
                                                        Width="1050px" Height="250px" AutoGenerateColumns="False" AutoExpandGroups="false"
                                                        PageSize="5" AllowMultiRowSelection="false" GridLines="None" AllowSorting="true"
                                                        OnNeedDataSource="gvRawDetails_NeedDataSource">
                                                        <%--  >--%>
                                                        <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="" />
                                                        <MasterTableView AllowMultiColumnSorting="True">
                                                            <Columns>
                                                                <telerik:GridBoundColumn DataField="FileRaeted" HeaderText="Files in Queue" SortExpression="FileRaeted">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="ip" HeaderText="Files sent to FTP " SortExpression="ip">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataField="FileFailure" HeaderText="Files re-tried sending to FTP"
                                                                    SortExpression="FileFailure">
                                                                </telerik:GridBoundColumn>
                                                            </Columns>
                                                        </MasterTableView>
                                                        <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">
                                                            <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
                                                            <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="" />
                                                        </ClientSettings>
                                                    </telerik:RadGrid>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </NestedViewTemplate>
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true">
                                <Scrolling UseStaticHeaders="true" AllowScroll="true" />
                                <Scrolling />
                            </ClientSettings>
                        </telerik:RadGrid>
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>

 

And code behind for radgrid

 

  protected void gvJobDetails_onItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            DateTime jobDate;
            DateTime.TryParse(txtSelectDate.Text, out jobDate);

            int jobNumber = Convert.ToInt32(ddlSelectJob.SelectedItem.Value);
            string offloadType = ddlOffloadType.SelectedItem.Text;
            if (e.CommandName == "ExpandCollapse" && e.Item is GridDataItem)
            {
                GridDataItem parentItem = e.Item as GridDataItem;
                string instanceId = parentItem["INSTANCEID"].Text.ToString();
                // txtToFtp.Text = Convert.ToString(instanceId);
                lblInstance.Text = Convert.ToString(instanceId);
                RadGrid rg = parentItem.ChildItem.FindControl("gvInstanceDetails") as RadGrid;
                rg.Rebind();
                RadGrid gvRaw = parentItem.ChildItem.FindControl("gvRawDetails") as RadGrid;
                gvRaw.Rebind();
                

            }
            if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item is GridDataItem)
            {
                if (ddlOffloadType.SelectedItem.Text == "Formatted Offload")
                {
                ((GridDataItem)e.Item).ChildItem.FindControl("pnlDetails").Visible = !e.Item.Expanded;
                }
                if (ddlOffloadType.SelectedItem.Text == "Raw Offload")
                {
                    ((GridDataItem)e.Item).ChildItem.FindControl("pnlRawDetail").Visible = !e.Item.Expanded;
                }

                foreach (GridItem item in e.Item.OwnerTableView.Items)
                {
                    if (item.Expanded && item != e.Item)
                    {
                        item.Expanded = false;
                    }
                }
            }
          
        }
        protected void Page_PreRender(object sender, EventArgs e)
        {

            // gvJobDeatail.Rebind();

        }
        protected void RadGrid_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                (e.Item.FindControl("gvInstanceDetails") as RadGrid).NeedDataSource += new GridNeedDataSourceEventHandler(gvInstanceDetails_NeedDataSource);
                (e.Item.FindControl("gvRawDetails") as RadGrid).NeedDataSource += new GridNeedDataSourceEventHandler(gvInstanceDetails_NeedDataSource);
            }
        }
        protected void gvJobDetails_PreRender(object sender, EventArgs e)
        {
            HideExpandColumnRecursive(gvJobDeatail.MasterTableView);
        }
        public void HideExpandColumnRecursive(GridTableView tableView)
        {
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
            {
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
                {
                    if (nestedView.Items.Count == 0)
                    {
                        nestedView.ParentItem.Expanded = false;
                    }
                    else
                    {
                        nestedView.ParentItem.Expanded = true;
                    }
                }
            }
        }

Eyup
Telerik team
 answered on 26 Aug 2015
2 answers
165 views

I have rad search box and bind it to a dataset in the page load event. I have auto complete disabled. When I type in four letters and click the search icon I just get a graphic of something churning. I wait 2 minutes and the drop down never appears. Is there anything else I have to do to get it to work.

 c# code in the page load event. The datasource "ds" does come back from my wcf service correct.

--===========================================

schUtility.MinFilterLength = 4;
schUtility.MaxResultCount = 15;
schUtility.DataValueField = "cust_name";
schUtility.DataTextField = "cust_id";
schUtility.DataSource = ds;
schUtility.DataBind();

--===========================================

I ask, because I'm on version 729.45 and it has issues. The wizard, for example, will not validate even though I cut and paste code from Telerik's web site. I also have issues with other controls, so I am not sure if the control is not working for me because of a bug or if I am doing something wrong.

Aneliya Petkova
Telerik team
 answered on 26 Aug 2015
2 answers
190 views

I have a RadEditor in form view like this:

<telerik:RadEditor runat="server" ID="txtNote" OnDataBinding="txtNote_DataBinding" OnExportContent="txtNote_ExportContent" Height="180px" Width="100%" EditModes="Design">
                                            <Tools>
                                                <telerik:EditorToolGroup>
                                                    <telerik:EditorTool Name="Cut" />
                                                    <telerik:EditorTool Name="Copy" />
                                                    <telerik:EditorTool Name="Paste" />
                                                </telerik:EditorToolGroup>
                                            </Tools>
                                        </telerik:RadEditor>

 ​For whatever reason, this always return empty string

                var txtNote = (fv.FindControl("txtNote") as RadEditor);
                if (txtNote.Text == "") // this is always true

I also try Content, Html, GetHtml() and they are all the same.

 

Ianko
Telerik team
 answered on 26 Aug 2015
1 answer
93 views

Hello,

If there is css class applied to link from Hyperlink Manager and try to remove link from text, link is not removed. When you remove css class from link and then try to remove link from text, it will remove link properly.

Steps to reproduce issue:

1. Give link to any text using Hyperlink Manager and also apply any css class.
2. Try to remove link from text using Unlink command. Link will ot be removed.
3. Now first remove class from text to which link is given and then remove link from text, it will be removed properly.

Can you please provide a solution to this issue ?

Thanks,
Khushboo

Ianko
Telerik team
 answered on 26 Aug 2015
6 answers
706 views
Hi,

I'm trying to remove styles on RadButton as said in this topic: http://www.telerik.com/forums/remove-styles-radlinkbutton
However, this doesn't work at all, I keep getting default style on IE 8 or Firefox (by removing class with firebug or IE dev toolbar, I get the good result).

Here is my code:
<telerik:RadButton ID="RadButtonValidate" runat="server" Text="Valider" ButtonType="StandardButton" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false" EnableBrowserButtonStyle="false" EnableTheming="false" EnableAjaxSkinRendering="false" />


I use Telerik ASP.NET version 2014.1.225.45.
Can you help me ?
Danail Vasilev
Telerik team
 answered on 26 Aug 2015
4 answers
103 views
Is it possible to combine filtering and web service binding within the same Rad Drop Down Tree control?

Thanks in advance for your answer,

Giorgos
Peter Filipov
Telerik team
 answered on 26 Aug 2015
3 answers
249 views

Hello,

        One of our large customers is currently using MS office word to document information. As they plan to migrate to MOSS 2007, the customers expect to have some functionality available in MS Word. One such requirement is that of hierarchical numbering e.g.


1.
       Demo text

1.1.    Demo text

1.1.1. Demo text

2.       Demo text

3.       Demo text

3.1.    Demo text

3.2.    Demo text

Rich textbox editor available OOB with MOSS 2007 doesn’t support hierarchical numbering or bullets. I evaluated telerik editor but was unable to achieve this requirement. Can you please tell me if telerik plans to implement this functionality? or if it is already implemented, then how to use it.

Thanks,
Swaminathan B

Ianko
Telerik team
 answered on 26 Aug 2015
1 answer
78 views
Hello,  I was looking your scheduler sample for wok with resources and my question is fi I can place the resourses on the left of the and place the dates in vertical view.
Hristo Valyavicharski
Telerik team
 answered on 26 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?