Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
476 views
Hello Team,

Please suggest me how to Save the Filter Text Value and Bind it Back to the Filter Text Box on Telerik Grid Reload as my requirement need to Bind the Filter text until the User Logs Off the system. I am using "2011.2.712.40" Telerik Version in my Project.

The Code I am using for my Grid is:

<div id="CmeGrid" style="padding-bottom: 5px;">
             <telerik:RadGrid ID="rdGrdInbox" runat="server" AllowFilteringByColumn="True" AllowSorting="True"
                        AllowPaging="True" CellSpacing="0" GridLines="None" AutoGenerateColumns="False"
                        PageSize="15" OnItemCommand="rdGrdInbox_ItemCommand" OnItemCreated="rdGrdInbox_ItemCreated"
                        Width="100%">
                        <MasterTableView DataKeyNames="grant_id">
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn DataField="action_required" AllowFiltering="true" SortExpression="action_required"
                                    UniqueName="action_required">
                                    <HeaderTemplate>
                                        <asp:LinkButton ID="lblheaderActionItems" runat="server" Font-Bold="true" Font-Underline="false"
                                            CommandName='Sort' CommandArgument='action_required'>Action required</asp:LinkButton>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="btnAction" runat="server" Font-Underline="true" ForeColor="Blue"
                                            Text='<%#Eval("action_required") %>' CommandName="edit" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn FilterControlWidth="80%" DataField="grant_display_id" HeaderText="Request ID"
                                    SortExpression="grant_display_id" UniqueName="grant_display_id" ShowFilterIcon="true">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterControlWidth="80%" DataField="grant_id" HeaderText="Request ID"
                                    Visible="false" SortExpression="grant_id" UniqueName="grant_id" ShowFilterIcon="true">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn FilterControlWidth="80%" DataField="activity_type" HeaderText="Type of Request"
                                    SortExpression="grant_id" UniqueName="activity_type" ShowFilterIcon="true">
                                </telerik:GridBoundColumn>
                                <telerik:GridDateTimeColumn AutoPostBackOnFilter="true" FilterControlWidth="100px"
                                    DataField="date_submitted" HeaderText="Date Submitted" SortExpression="date_submitted"
                                    UniqueName="date_submitted" PickerType="DatePicker" DataFormatString="{0:d}"
                                    FilterDelay="500" ShowFilterIcon="false">
                                </telerik:GridDateTimeColumn>
                                <telerik:GridBoundColumn FilterControlWidth="80%" DataField="grant_external_status"
                                    HeaderText="Status" SortExpression="grant_status" UniqueName="grant_status" ShowFilterIcon="true">
                                </telerik:GridBoundColumn>
                                <%--abdulr--%>
                                <telerik:GridTemplateColumn DataField="activity_title" FilterControlWidth="200px"
                                    AllowFiltering="true" SortExpression="activity_title" UniqueName="activity_title">
                                    <HeaderTemplate>
                                        <asp:LinkButton ID="lblheaderProgramTitle" runat="server" Font-Bold="true" Font-Underline="false"
                                            CommandName='Sort' CommandArgument='program_title'>Activity Title</asp:LinkButton>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="btnTitle" runat="server" Font-Underline="true" ForeColor="Blue"
                                            Text='<%#Eval("activity_title") %>' CommandName="select" />
                                    </ItemTemplate>
                                    <ItemStyle CssClass="inboxgridWrap" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridNumericColumn FilterControlWidth="50px" DataField="requested_amount"
                                    HeaderText="Requested Amount" SortExpression="requested_amount" UniqueName="requested_amount"
                                    ShowFilterIcon="true" HeaderStyle-Width="90px" DataType="System.Decimal">
                                </telerik:GridNumericColumn>
                                <telerik:GridNumericColumn FilterControlWidth="50px" DataField="approved_amount"
                                    HeaderText="Approved Amount" SortExpression="approved_amount" UniqueName="approved_amount"
                                    ShowFilterIcon="true" HeaderStyle-Width="90px" DataType="System.Decimal">
                                </telerik:GridNumericColumn>
                                <telerik:GridTemplateColumn HeaderText="View/Print Agreement" SortExpression="loa_signoff_ind"
                                    AllowFiltering="false" ShowFilterIcon="false" HeaderStyle-Font-Bold="true">
                                    <ItemTemplate>
                                        <asp:LinkButton runat="server" ID="btn_view_print_agreement" Font-Underline="true"
                                            ForeColor="Blue" Text='View/Print Agreement' CommandName="viewloa"></asp:LinkButton>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Bold="True" />
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <GroupingSettings CaseSensitive="false" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
             </telerik:RadGrid>
</div>

Please go through the Link Below to Understand my requirement better.
LINK: http://screencast.com/t/Ip7dbtmg

Please let me know how I can save the Filter Criteria and restore on reload of Grid or if there is any inbuilt property of Telerik to do the same operation which I want. Please help me at the earliest.

Thanks,
Saurabh
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2013
1 answer
176 views
Hi,

Some of my users are complaining that the RadComboBox sometimes does not render properly in IE9. I'm not able to replicate to exactly, but here are the screenshots.

Please suggest if someone else has reported the same issue, and is there a solution/workaround available ?

Browser : IE 9.0
Telerik ASP.NET Ajax : 2013.2.611.40

Nishant
Magdalena
Telerik team
 answered on 26 Aug 2013
1 answer
91 views
Just as the title says, I want to be able to turn the self-referencing hierarchy on and off. I have a RadGrid of orders that I am creating the structure for in the code behind file, and a RadToolBar with a button for toggling the hierarchy. There are other buttons on the toolbar that I am using client-side script to respond to.

Code to build the grid structure.
private void InitializeGrid()
{
    try
    {
        // add columns
        Telerik.Web.UI.GridBoundColumn boundColumn = new Telerik.Web.UI.GridBoundColumn();
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "OrderId";
        boundColumn.UniqueName = "OrderId";
        boundColumn.HeaderText = "Order Id";
        boundColumn.DataType = typeof(System.Guid);
        boundColumn.Display = false;
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "Locked";
        boundColumn.UniqueName = "Locked";
        boundColumn.HeaderText = "Locked";
        boundColumn.DataType = typeof(System.Boolean);
        boundColumn.Display = false;
 
        Telerik.Web.UI.GridImageColumn imageColumn = new Telerik.Web.UI.GridImageColumn();
        uxOrderListControl.MasterTableView.Columns.Add(imageColumn);
        imageColumn.UniqueName = "LockImage";
        imageColumn.HeaderText = "L";
 
        imageColumn = new Telerik.Web.UI.GridImageColumn();
        uxOrderListControl.MasterTableView.Columns.Add(imageColumn);
        imageColumn.UniqueName = "A";
        imageColumn.HeaderText = "A";
 
        imageColumn = new Telerik.Web.UI.GridImageColumn();
        uxOrderListControl.MasterTableView.Columns.Add(imageColumn);
        imageColumn.UniqueName = "E";
        imageColumn.HeaderText = "E";
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "OrderType";
        boundColumn.UniqueName = "OrderType";
        boundColumn.HeaderText = "Type";
        boundColumn.DataType = typeof(System.String);
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "CurrentOrderId";
        boundColumn.UniqueName = "CurrentOrderId";
        boundColumn.HeaderText = "Number";
        boundColumn.DataType = typeof(System.String);
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "OrderDate";
        boundColumn.DataFormatString = "{0:d}";
        boundColumn.UniqueName = "OrderDate";
        boundColumn.HeaderText = "Date";
        boundColumn.DataType = typeof(System.DateTime);
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "Total";
        boundColumn.DataFormatString = "{0:c}";
        boundColumn.UniqueName = "Total";
        boundColumn.HeaderText = "Total";
        boundColumn.DataType = typeof(System.Decimal);
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "BillToName";
        boundColumn.UniqueName = "BillToName";
        boundColumn.HeaderText = "Bill To Name";
        boundColumn.DataType = typeof(System.String);
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "SoldToName";
        boundColumn.UniqueName = "SoldToName";
        boundColumn.HeaderText = "Sold To Name";
        boundColumn.DataType = typeof(System.String);
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "Lookup";
        boundColumn.UniqueName = "Lookup";
        boundColumn.HeaderText = "Lookup";
        boundColumn.DataType = typeof(System.String);
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "NeedToEdi";
        boundColumn.UniqueName = "NeedToEdi";
        boundColumn.HeaderText = "Need To EDI";
        boundColumn.DataType = typeof(System.Boolean);
 
        boundColumn = new Telerik.Web.UI.GridBoundColumn();
        uxOrderListControl.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "ReferralInvoiceId";
        boundColumn.UniqueName = "ReferralInvoiceId";
        boundColumn.HeaderText = "Ref ID";
        boundColumn.DataType = typeof(System.Guid);
 
        uxOrderListControl.MasterTableView.DataKeyNames = new string[] { "OrderId", "ReferralInvoiceId" };
 
        if (_hierarchical)
        {
            uxOrderListControl.ClientSettings.AllowExpandCollapse = true;
            uxOrderListControl.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
            uxOrderListControl.MasterTableView.HierarchyDefaultExpanded = true;
            uxOrderListControl.MasterTableView.SelfHierarchySettings.ParentKeyName = "ReferralInvoiceId";
            uxOrderListControl.MasterTableView.SelfHierarchySettings.KeyName = "OrderId";
            uxOrderListControl.MasterTableView.SelfHierarchySettings.MaximumDepth = 2;
        }
    }
    catch
    {
        throw;
    }
}
#endregion
Antonio Stoilkov
Telerik team
 answered on 26 Aug 2013
3 answers
133 views
Hi. I have a problem abot radtreeview node click event. I list categories on treeview. when I click a node, it loads related datas on the right side of screen. First, I click a node, and it loads data (also, I can make debug.). But then, when I click a node, it doesn't show new realted data, also I can't do debug on code. It runs first time. Other times, it doesn't run.

Can someone give me an idea about how this happens?
Shinu
Top achievements
Rank 2
 answered on 26 Aug 2013
3 answers
207 views
When I delete a node using the context menu the node doesn't disappear after I rebuild the list of nodes that should be displayed.

In my RadTree I have reports on the 3rd level.  I have a context menu that allows me to delete the report at that node.   The context menu handler displays a prompt (using RadConfirm).   When OK is selected from the prompt, I execute __doPostBack on an asp button.  The handler for that button is where the deletion of the report happens (and it does delete it from the database just fine) and then it calls the subroutine that rebuilds the list of reports at that level and then tries to redisplay that on the tree.  However the node with the deleted report continues to be displayed.

And in my RadAjaxManager I think I have everything covered: the tree will update the tree and the button updaqtes the tree too.

Any help on this is greatly appreciated.  Here are the relevant pieces of code:

Here is the relevant part of the context menu handler:

 

Protected Sub rtvReports_ContextMenuItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeViewContextMenuEventArgs)
 
    Select Case e.Node.Level
        Case 1
             'Not important to example
        Case 2
             
            Dim ReportType As String = e.Node.ParentNode.Text
            Dim ReportName As String = e.Node.Text
            Dim Logid As String = e.Node.Value
            Dim ClientID As String = Session("ClientID")
            Select Case e.MenuItem.Value
                 Case "Delete"
                    Session("CurrentReportTreeNode") = e.Node.ParentNode
                    lbDeleteReportType.Text = e.Node.ParentNode.Text
                    lbDeleteReportName.Text = e.Node.Text
                    lbDeleteLogID.Text = e.Node.Value
                     
                    RadWindowManager1.RadConfirm("Delete Report: " & lbDeleteReportName.Text, "DeleteReportcallback", 300, 100, Nothing, "Delete Report Confirmation")
 
                    Exit Select
 
            End Select
    End Select
 
End Sub

Here is the client side function DeleteReportCallBack which seems to work fine:

function DeleteReportcallback(arg) {
    if (arg == true) {
        __doPostBack("ctl00$ContentPlaceHolder1$btnDelete", "");
    }
}

Here is the asp button:

<asp:button id="btnDelete" runat="server" Text="" height=0 width="0" style="background-color:white; border-color:White; border-width:0" OnCLick="btnDelete_Click" />

Here is the button handler and the subroutine that rebuilds the nodes at that level:

Protected Sub btnDelete_Click()
    Dim ReportType As String = lbDeleteReportType.Text       
    Dim ReportName As String = lbDeleteReportName.Text
    Dim LogID As String = lbDeleteLogID.Text
    DeleteReport(LogID, ReportName, ReportType)
     
    Dim CurrentNode As RadTreeNode = Session("CurrentReportTreeNode")
    LoadReports(CurrentNode)
 
End Sub
 
 
Sub LoadReports(curnode As RadTreeNode)
    Dim ReportType As String = curnode.Text
    Dim ReportTypeParent As String = curnode.ParentNode.Text
    Dim CLientID As String = Session("ClientID")
    Dim dt As New DataTable
     
    If curnode.Nodes.Count > 0 Then
        For I As Integer = curnode.Nodes.Count - 1 To 0 Step -1
            curnode.Nodes(I).Remove()
        Next
    End If
 
    dt = BindChartNames(ReportType, CLientID) 'Gets the relevant reports from the database
     
    If dt IsNot Nothing And dt.Rows.Count > 0 Then
        dt.DefaultView.Sort = "ReportName ASC"
        For Each row As DataRow In dt.Rows
            Dim node As New RadTreeNode()
            node.Text = row("ReportName").ToString()
            node.Value = row("LogID").ToString()
            node.ContextMenuID = "ReportMenu"
 
            node.HoveredCssClass = "TreeHover"
            curnode.Nodes.Add(node)
        Next
        curnode.Expanded = True
        curnode.ExpandMode = TreeNodeExpandMode.ClientSide
    End If
End Sub

And here is the ajax manager and the tree definition (minus some context menus not pertinent to my question):

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" >
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rtvReports">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rtvReports" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="pnlDetails"  />
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                <telerik:AjaxUpdatedControl ControlID="pnlReportType" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnOverwrite" >
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rtvReports" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
 
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" Skin="Office2010Black" InitialDelayTime="400" />
 
            <telerik:RadTreeView ID="rtvReports" runat="server" OnNodeExpand="rtvReports_NodeExpand"
                OnContextMenuItemClick="rtvReports_ContextMenuItemClick" 
                Skin="Office2010Silver" OnNodeClick="rtvReports_NodeClick"
                OnPreRender="rtvReports_PreRender">
                 
                <ContextMenus>
                    <telerik:RadTreeViewContextMenu runat="server" ID="ReportMenu" ClickToOpen="True">
                        <Items>
                            <telerik:RadMenuItem Text="Edit" Value="Edit">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Run" Value="Run">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Schedule" Value="Schedule">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Delete" Value="Delete">
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadTreeViewContextMenu>
 
 
 
                </ContextMenus>
            </telerik:RadTreeView>

One further note on this issue:  I have a Refresh function on the parent node to the reports in the context menu.  And after I delete a report node and the node is still there, I run the refresh command from the parent node and it calls the same LoadReports subroutine and it works fine.

Thanks for any help on this.

LoadReports

Hristo Valyavicharski
Telerik team
 answered on 26 Aug 2013
36 answers
355 views
Hi,

Sorry for the contentious sounding title but is this control in fact a beta?  The reason I ask is that it seems as though a lot of critical functionality is missing from it.  Such as the ability to easily setup and access the selected values.

I'd like to drop on a form and know that I can bind to a database field that contains a comma delimited list of values that should be checked.  Nope, can't do that.  I don't want to have to have an army of supplementary routines that support something that should have been included in a control.

Please advise on a time frame for this basic functionality being added.

Apologies if this is easy and can already be done but from what I see it can't be yet for a form control the easy allocation of values to and from a control should surely be the #1 priority?

Regards

Jon
Peter Filipov
Telerik team
 answered on 26 Aug 2013
3 answers
153 views
How to get file url from ImageManager, FlashManager,DocumentManager,MediaManager?

I use "OnClientCommandExecuting" event to get file url when click Insert.
Imgscript += "<script type=\"text/javascript\">";
                Imgscript += "function changeImageManager(editor, args) {";
                Imgscript += "if (args.get_commandName() == \"ImageManager\" || args.get_commandName() == \"InsertImage\"  ) {";
                Imgscript += "var callbackFunction = function (sender, args) {";
                Imgscript += "var result = args.get_value();";
                Imgscript += "$('#" + owtxt.ClientID + "').val(result.src);";
                Imgscript += "result = Telerik.Web.UI.Editor.Utils.getOuterHtml(result);";
                Imgscript += "editor.pasteHtml(result, \"ImageManager\");";
                Imgscript += "};";
                Imgscript += "args.set_callbackFunction(callbackFunction);";
                Imgscript += "}";
 So:
use: "result.src" to get Image Url. from imageManager/insertImage
What about FlashManager,DocumentManager,MediaManager?
Please tell me how to get file url?
result.movie or result.src or result.embed or another?
----
Thanks and Best regards.
Ianko
Telerik team
 answered on 26 Aug 2013
1 answer
215 views
Hi,
In Asp.net Is there any way to display Rad pie Chart look like 3D, like as in attachment.
Peshito
Telerik team
 answered on 26 Aug 2013
5 answers
115 views
Hello,
I'm trying to make a Chart change its displayed info according to what data is displayed in a RadGrid after a filter is used. Allowing for a user to view the data in 2 forms.

Example:  When first loading the page the grid contains 96 results and the chart displays the data accordingly with a total of 96 as well.  However, once a user were to use a filter (such as only wanting to see usernames that contain the letter 'z') and hits enter the grid changes to only display 3 results but the chart still displays 96 from its original view.

What is the correct way of accomplishing this task?  I've attempted several events from the grid:
- OnItemCommand()
- OnItemDataBound()

As well as Chart methods like PreRender()

I've been able to hold the required data the Chart should display in a list but it just won't refresh like the Grid does when a filter is used.
Any ideas?
Barbaros Saglamtimur
Top achievements
Rank 1
 answered on 26 Aug 2013
2 answers
143 views
I am using the predefined dialogs (radalert, radconfirm and radprompt) from the server methods RadAlert, RadConfirm and RadPrompt of the RadWindowManager.It is possible for the user to move the dialog. Is there any way to prevent the Draggable/Moving option for the server methods RadAlert, RadConfirm and RadPrompt of the RadWindowManager.
Siva
Top achievements
Rank 1
 answered on 26 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?