Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
116 views
Hi
Here is one scenario which I will like you to highlight me further with some code.

I wish to have a radtreeview that needs to be populated from code behind through generic list.I saw the demo on your website but it doesn't tell me of generic list or it will be appreciable if you could explain with some other code.
Plamen
Telerik team
 answered on 20 Mar 2012
1 answer
115 views

I have a radgrid that goes 3 deep, when i click on something on the 3rd tier down or at that location and then do something, i want the grid to open back up to that location after rebind how can I do this.

<asp:Panel ID="pnlGrids" runat="server">
                                <asp:LinkButton id="lnkAddCat" runat="server">Add Category</asp:LinkButton>
                                <telerik:RadGrid ID="myRadGrid" runat="server" Width="100%" BorderWidth="1px" CellPadding="4" Skin="Web20">
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="intCategoryId" HierarchyDefaultExpanded="false" Font-Size="10" Font-Names="Veranda,arial,sans-serif" 
                                    HeaderStyle-HorizontalAlign="Center" Name="MasterGrid" ExpandCollapseColumn-ButtonType="ImageButton" HierarchyLoadMode="ServerBind"
                                    ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                    <ItemStyle HorizontalAlign="Center" /><AlternatingItemStyle BackColor="#B0C4DE"  HorizontalAlign="Center" /><HeaderStyle ForeColor="White" Font-Bold="true"  />
                                    <DetailTables>
                                        <telerik:GridTableView Name="myManufacGrid" runat="server" DataKeyNames="intManufacturerId" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10"
                                            AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                            ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                            <ParentTableRelation>
                                                <telerik:GridRelationFields DetailKeyField="intCategoryId" MasterKeyField="intCategoryId" />
                                            </ParentTableRelation>
                                            <HeaderStyle Font-Bold="true" HorizontalAlign="Center" CssClass="MostInnerHeaderStyle" />
                                            <ItemStyle CssClass="MostInnerItemStyle" HorizontalAlign="Center" />
                                            <AlternatingItemStyle CssClass="MostInnerAlernatingItemStyle" HorizontalAlign="Center" />
                                            <DetailTables>
                                            <telerik:GridTableView DataKeyNames="intMakeID" Name="myMakeGrid" Width="100%" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10"
                                                AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                                ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                                    <ParentTableRelation>
                                                    <telerik:GridRelationFields DetailKeyField="intManufacturerId" MasterKeyField="intManufacturerId" />
                                                    </ParentTableRelation>
                                                    <HeaderStyle Font-Bold="true" HorizontalAlign="Center" CssClass="InnerSubHeaderStyle" />
                                                    <ItemStyle CssClass="InnerSubItemStyle" HorizontalAlign="Center"  />
                                                    <AlternatingItemStyle CssClass="InnerSubAlernatingItemStyle" HorizontalAlign="Center" />
                                                    <Columns>
                                                         <telerik:GridBoundColumn HeaderText="MAKE|MODEL" DataField="strmake" />
                                                         <telerik:GridTemplateColumn HeaderText="Edit">
                                                            <ItemTemplate>
                                                                    <asp:ImageButton runat="server" ID="imgMakeEdit"  CommandArgument='<%# bind("intMakeID") %>' CommandName="MakeEdit" ImageUrl="~/Images/edit_icon.png" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn HeaderText="Archive">
                                                            <ItemTemplate>
                                                                    <asp:ImageButton runat="server" ID="imgMakeArchive"  CommandArgument='<%# bind("intMakeID") %>' CommandName="MakeArchive" ImageUrl="~/Images/edit_icon.png" OnClientClick="return confirm('Are you sure you want to archive Category, This will Archive everything Underneath as well.');" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                            </telerik:GridTableView>
                                        </DetailTables>
                                            <Columns>
                                                <telerik:GridBoundColumn HeaderText="MANUFACTURERS" DataField="strManufacturer"></telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn HeaderText="ADD MAKE\MODEL">
                                                    <ItemTemplate>
                                                            <asp:ImageButton runat="server" ID="imgAddPosition"  CommandArgument='<%# bind("intManufacturerId") %>' CommandName="AddMake" ImageUrl="~/Images/29.png" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn HeaderText="Edit">
                                                    <ItemTemplate>
                                                            <asp:ImageButton runat="server" ID="imgManEdit"  CommandArgument='<%# bind("intManufacturerId") %>' CommandName="ManEdit" ImageUrl="~/Images/edit_icon.png" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn HeaderText="Archive">
                                                    <ItemTemplate>
                                                            <asp:ImageButton runat="server" ID="imgManArchive"  CommandArgument='<%# bind("intManufacturerId") %>' CommandName="ManArchive" ImageUrl="~/Images/edit_icon.png" OnClientClick="return confirm('Are you sure you want to archive Category, This will Archive everything Underneath as well.');" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                    <Columns>
                                    <telerik:GridBoundColumn HeaderText="Category" DataField="strCategory" />
                                    <telerik:GridTemplateColumn HeaderText="Add Manufacturer">
                                        <ItemTemplate>
                                                <asp:ImageButton runat="server" ID="imgAdd"  CommandArgument='<%# bind("intCategoryId") %>' CommandName="AddMan" ImageUrl="~/Images/29.png" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Edit">
                                        <ItemTemplate>
                                                <asp:ImageButton runat="server" ID="imgCatEdit"  CommandArgument='<%# bind("intCategoryId") %>' CommandName="CatEdit" ImageUrl="~/Images/edit_icon.png" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Archive">
                                        <ItemTemplate>
                                                <asp:ImageButton runat="server" ID="imgCatArchive"  CommandArgument='<%# bind("intCategoryId") %>' CommandName="CatArchive" ImageUrl="~/Images/edit_icon.png" OnClientClick="return confirm('Are you sure you want to archive Category, This will Archive everything Underneath as well.');" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                </MasterTableView>
                                </telerik:RadGrid>
                            </asp:Panel>
                        </td>
                    </tr>
                </table>


If (e.CommandName = "CatArchive") Then
           Dim CatID As Integer = Convert.ToInt32(e.CommandArgument)
           sql = "Update tblCategory set bitArchive = 1 where intCategoryId = " & CatID
           insertUpdateDelete(sql)
           myRadGrid.Rebind()
       End If
Shinu
Top achievements
Rank 2
 answered on 20 Mar 2012
3 answers
135 views
Hi there,

I'm using radmenu in my project its is binding with dataset.
I want to add search text box next to Radmenu, if the name of the item entered in the text box is present in the menu, then menu should open and the item should be highlight.

Regards,

Leo
Princy
Top achievements
Rank 2
 answered on 20 Mar 2012
4 answers
107 views
I am using radgrid in an ASP.NET application. I am trying to handle many events from client side. But facing some problems because  when we click on any cell in radgrid, the order of event firing is different in IE 8 and Firefox. Here is the order:

IE 8:
 1. RowDeselectEvent (previous row)
 2. RowSelectEvent (current row)
 3. RowClickEvent (current row)

Firefox:
  1. RowClickEvent (current row)
  2. RowDeselectEvent (previous row)
  3. RowSelectEvent (current row)

Why is this disparity? This difference in order is making my implementation very difficult.  
Radoslav
Telerik team
 answered on 20 Mar 2012
2 answers
59 views
Hi Guys,


I saw the below link and came to know some features like
TickDistance ,AutoRange
but all is for Telerik.Windows.Controls.RadChart() (Window application , Please correct me if i am wrong)

http://www.telerik.com/help/wpf/radchart-features-axes-x-axis.html#seeAlsoToggle

Can i get all for Web Application?

Karthik.K
Karthik Kantharaj
Top achievements
Rank 1
 answered on 20 Mar 2012
8 answers
373 views
Hello,

I'm trying to get the value of a column in a selected row.
I've tried to do the following:

(VB)
For each Row as GridDataItem in gridMovimento.SelectedItems
Ids += Row("DFid")
Next

So that "" is the count = 0 ...
Can anyone help me? 

Ty...
Princy
Top achievements
Rank 2
 answered on 20 Mar 2012
1 answer
140 views
Hai,
I use rad window. i want to call the event when i close the rad window.( need when i click the radwondow close x ).
currenty i did nt find any events.

Princy
Top achievements
Rank 2
 answered on 20 Mar 2012
0 answers
67 views

Here is a Snippet that seems to Fail to convert to VB correctly:
If you can do this one I have two more from the same project that also fail.
As you may note in the Imports statements - this conversion is taken from a Caliburn Micro learning sample project

Bob


namespace HelloScreensWPF.Shell {
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Framework;
    using Caliburn.Micro;

    public class ApplicationCloseStrategy : ICloseStrategy<IWorkspace> {
        IEnumerator<IWorkspace> enumerator;
        bool finalResult;
        Action<bool, IEnumerable<IWorkspace>> callback;

        public void Execute(IEnumerable<IWorkspace> toClose, Action<bool, IEnumerable<IWorkspace>> callback) {
            enumerator = toClose.GetEnumerator();
            this.callback = callback;
            finalResult = true;

            Evaluate(finalResult);
        }

        void Evaluate(bool result)
        {
            finalResult = finalResult && result;

            if (!enumerator.MoveNext() || !result)
                callback(finalResult, new List<IWorkspace>());
            else
            {
                var current = enumerator.Current;
                var conductor = current as IConductor;
                if (conductor != null)
                {
                    var tasks = conductor.GetChildren()
                        .OfType<IHaveShutdownTask>()
                        .Select(x => x.GetShutdownTask())
                        .Where(x => x != null);

                    var sequential = new SequentialResult(tasks.GetEnumerator());
                    sequential.Completed += (s, e) => {
                        if(!e.WasCancelled)
                        Evaluate(!e.WasCancelled);
                    };
                    sequential.Execute(new ActionExecutionContext());
                }
                else Evaluate(true);
            }
        }
    }
}

Bob
Top achievements
Rank 1
 asked on 20 Mar 2012
9 answers
384 views
I have a Page Which has a user control which in turn generates dynamic user controls and within one of the UC, i have a rad grid in which I would like to add a tooltip manager to handle thumbs up and thumbs down tooltip. The problem i am having is that when i mouse over the image, i does bring up a panel with the loading icon but then closes right away . I doesn't load the panel with the literal control ( a one liner) at all but I do see the title of the tooltip.
I've wasted to much time trying to get this working... even trying a client side but without success...

I'm not sure if the problem has anything to do with the dynamic nature of the user controls being generated... so on every Page_Init (of the parent user control), I load the detail control below dynamically. So everytime there is a postback, example due to the AjaxRequest of the TooltipManager, it regenerate the radgrid, and hence the tooltip controls...

I'm not sure how to handle this one... i'll probably try a declarative radtooltip on each row...because I'm running out of options and this is taking way to much time

      protected void Page_Init(object sender, EventArgs e)
       {
           //Check SessionContext for selected MiniTab
           if (!String.IsNullOrEmpty(SessionContext.GetContextValue<string>("miniTab")))
           {
               _currentMiniTab = SessionContext.GetContextValue<string>("miniTab");
           }
           else
           {
               _currentMiniTab = SetCurrentSessionContextOfMiniTab("SpecialOffers");
           }
 
           // Add Click Event on Mini Tabs
           SetClickableMiniTabDivs();
 
           SetJavascript();
 
           if (IsPostBack)
           {
               // Get event arguments from post back.
               string eventArg = Request["__EVENTARGUMENT"];
 
               // Determine if postback is a custom postback from onClick of DIV Tabs
               if (!string.IsNullOrEmpty(eventArg) && eventArg.StartsWith("@@@@"))
               {
                   //Redirect to appropriate OnClick Event of the tab
                   CallDivEventHandler(eventArg);
               }
 
           }
 
           //Load Detail Control after ViewState is Initialized
           LoadDetailControl(_currentMiniTab);
 
       }      
 
private void LoadDetailControl(string miniTab)
       {
           phMiniTabContent.Controls.Clear();
           UserControl ucTabContent = (UserControl)LoadControl(GetUserControlPath(miniTab));
           ucTabContent.ID = "DynamicUserControl_MiniTab_" + miniTab;
           phMiniTabContent.Controls.Add(ucTabContent);
           SetCssClassForSelectedMiniTab(miniTab);
       }



This is my user control where I want to tooltipify using RadToolTipManager
<telerik:RadToolTipManager ID="rttManager" runat="server" RelativeTo="Element" Width="225px"
    Height="100px" Style="z-index: 31000" Position="BottomLeft" Title="Like or Dislike" HideDelay="10" HideEvent="ManualClose"
    OnAjaxUpdate="rttManager_AjaxUpdate">
</telerik:RadToolTipManager>
<telerik:RadGrid ID="grdSpecialOffers" runat="server" AutoGenerateColumns="False"
    CellSpacing="0" EnableViewState="False" GridLines="None" OnNeedDataSource="grdSpecialOffers_NeedDataSource"
    OnItemCreated="grdSpecialOffers_ItemCreated" OnItemDataBound="grdSpecialOffers_ItemDataBound" ShowHeader="False" Skin="gmBlueGrid"
    EnableEmbeddedSkins="false" Height="346px" Style="outline: none;">
    <ClientSettings>
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
    <MasterTableView EnableViewState="False" DataKeyNames="AccountId, OfferId">
        <NoRecordsTemplate>
            No Special Offers
        </NoRecordsTemplate>
        <Columns>
            <telerik:GridTemplateColumn FilterControlAltText="Filter itemImage column" UniqueName="itemImage"
                ItemStyle-Width="50px">
                <ItemTemplate>
                    <a href="#">
                        <img id="imgPicture" runat="server" alt='<%# DataBinder.Eval(Container.DataItem, "DescLine1")%>'
                            src="" border="0" width="36" height="36" /></a>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn FilterControlAltText="Filter itemDescription column"
                UniqueName="itemDescription" ItemStyle-Width="300px">
                <ItemTemplate>
                    <asp:HyperLink ID="descriptionHyperlink" runat="server" CssClass="blackHyperlink"
                        NavigateUrl="#">
                        <asp:Label ID="lblDescriptionLine1" runat="server" CssClass="soDescLine1"> <%# DataBinder.Eval(Container.DataItem, "DescLine1")%></asp:Label></asp:HyperLink><br />
                    <asp:Label ID="lblDescriptionLine2" runat="server" CssClass="soDescLine2"> <%# DataBinder.Eval(Container.DataItem, "DescLine2")%></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn FilterControlAltText="Filter itemIcons column" UniqueName="itemIcons"
                ItemStyle-Width="50px">
                <ItemTemplate>
                    <div class="soAddButton">
                        <telerik:RadButton ID="btnAddItem" runat="server" Width="48" Height="23" NavigateUrl="#">
                            <Image ImageUrl="../Images/btAddCharcoal.gif" />
                        </telerik:RadButton>
                    </div>
                    <div class="soThumbsUpDown">
                        <telerik:RadButton ID="btnThumbsDown" runat="server" Width="13" Height="14" OnCommand="btnThumbsUpDown_Command"
                            CommandName="Down" CssClass="soThumbsDown">
                            <Image ImageUrl="../Images/icoThumbsDown.gif" />
                        </telerik:RadButton>
                        <telerik:RadButton ID="btnThumbsUp" runat="server" Width="13" Height="14" OnCommand="btnThumbsUpDown_Command"
                            CommandName="Up" CssClass="soThumbsUp">
                            <Image ImageUrl="../Images/icoThumbsUp.gif" />
                        </telerik:RadButton>
                    </div>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


My Code behind to add the controls to tooltipify to the RadToolTipManager and the AjaxRequest
protected void grdSpecialOffers_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
    {
        //Find Control to have tooltip
        RadButton btnThumbsUp = (RadButton)e.Item.FindControl("btnThumbsUp");
        if (btnThumbsUp != null)
        {
            if (rttManager != null)
            {
                rttManager.TargetControls.Add(btnThumbsUp.ClientID, "LIKE", true);
            }
 
        }
 
        //Find Control to have tooltip
        RadButton btnThumbsDown = (RadButton)e.Item.FindControl("btnThumbsDown");
        if (btnThumbsDown != null)
        {
            if (rttManager != null)
            {
                rttManager.TargetControls.Add(btnThumbsDown.ClientID, "DISLIKE", true);
            }
 
        }
 
    }
}
 
 
protected void grdSpecialOffers_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
 
        HtmlImage imgPicture = (HtmlImage)e.Item.FindControl("imgPicture");
        // For each item in the DataRowView, check if picture exist, else show default picture
        DataRowView drv = (DataRowView)e.Item.DataItem;
        if (drv != null)
        {
            string imageFile = drv["Picture"].ToString();
            //Check of image file exist before rendering it on the rptDeals, otherwise replace it by the default.gif
            if (!File.Exists(Server.MapPath("/" + SessionContext.AppServerName + "/Data_Images/" + imageFile)))
            {
                drv["Picture"] = "default.gif";
                imgPicture.Src = "../Data_Images/Offers/default.gif";
            }
        }
 
        RadButton btnThumbsUp = (RadButton)e.Item.FindControl("btnThumbsUp");
        RadButton btnThumbsDown = (RadButton)e.Item.FindControl("btnThumbsDown");
 
        //For each item in Special Offer, Add the OfferId as COmmand Argument.
        btnThumbsUp.CommandArgument = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["OfferId"].ToString();
        btnThumbsDown.CommandArgument = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["OfferId"].ToString();
 
        if (drv["Rating"].ToString() == "3")
        {
            btnThumbsUp.Image.ImageUrl = "../Images/icoThumbsUpSelected.gif";
            //btnThumbsUp.CssClass = "soThumbsSelected";
        }
        else if (drv["Rating"].ToString() == "1")
        {
            btnThumbsDown.Image.ImageUrl = "../Images/icoThumbsDownSelected.gif";
            //btnThumbsDown.CssClass = "soThumbsSelected";
        }
 
        //Ajaxify the buttons so that they are refreshed by partial postbacks
        soRadAjaxManagerProxy.AjaxSettings.AddAjaxSetting(btnThumbsUp, btnThumbsUp);
        soRadAjaxManagerProxy.AjaxSettings.AddAjaxSetting(btnThumbsUp, btnThumbsDown);
        soRadAjaxManagerProxy.AjaxSettings.AddAjaxSetting(btnThumbsDown, btnThumbsUp);
        soRadAjaxManagerProxy.AjaxSettings.AddAjaxSetting(btnThumbsDown, btnThumbsDown);
 
        ////Find ThumbsUp Control to have tooltip - Used ItemDataBound Instead as a test
        //if (btnThumbsUp != null)
        //{
        //    if (rttManager != null)
        //    {
        //        rttManager.TargetControls.Add(btnThumbsUp.ClientID, "LIKE", true);
        //    }
 
        //}
 
        ////Find ThumbsDown Control to have tooltip
        //if (btnThumbsDown != null)
        //{
        //    if (rttManager != null)
        //    {
        //        rttManager.TargetControls.Add(btnThumbsDown.ClientID, "DISLIKE", true);
        //    }
 
        //}
    }
}
 
protected void rttManager_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
{
    LiteralControl litControl = new LiteralControl();
    if (e.Value == "LIKE")
    {
        litControl.Text = "LIKE this offer <br/>(Show me more offer like this)";
    }
    else
    {
        litControl.Text = "DISLIKE this offer";
    }
    e.UpdatePanel.ContentTemplateContainer.Controls.Add(litControl);
}
Hunter
Top achievements
Rank 1
 answered on 19 Mar 2012
1 answer
139 views
Hi,

   how can the width of the RadTextBox can be resized according to the aspx page width when cols property is specified and browser width is changed.

Regards
Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Mar 2012
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?