Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
111 views
Colleagues,

Who knows if it is possible to set a custom range of dates to scheduler's view? Say, Aplril 5th and April 6th. The default behavion gives "day", "week" and "month" options which is not always convinient for users.

Thank you all for any piece of advice...

- Stepan.
Veronica
Telerik team
 answered on 05 Apr 2011
1 answer
139 views
Hi,  I have a PanelBar with one RadPanelItem, which has  an itemtemplate with a RadGrid inside. Outside of the PanelBar, I have a treeview.  The behavior I want is that when an item is selected under the treeview, it causes an AJAX request that refreshes the RadGrid only inside the RadPanelItem with new data based on the treeview item the user selected without causing a full postback. 

The way I'm trying to get this to work is by capturing the onClientNodeClicking of the Treeview, I then attempt a ajaxManager.ajaxRequest call, and I can see that server-side code is executed, but for some reason nothing changes after it's done, which leads me to believe that I'm not doing something right.

Here's simplified code of what I'm trying to do:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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>
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script language="javascript" type="text/javascript">
 
 
    function clientNodeClicking(sender, args) {
        refreshGrid(args);
    }
 
    function clientNodeChecking(sender, args) {
        refreshGrid(args);
            }
             
   function refreshGrid(args) {
 
       InitiateAsyncRequest(args.get_node().get_value());
   }
    
    function InitiateAsyncRequest(arguments) {
        var ajaxManager = $find("<%= ramNotification.ClientID %>");
        ajaxManager.ajaxRequest(arguments);
    }
</script>
 </telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
       <telerik:RadScriptManager ID="rsmMain" runat="server">
     </telerik:RadScriptManager>
    <div>
       <telerik:RadAjaxManager ID="ramNotification" runat="server">
            
        </telerik:RadAjaxManager>
     
      <telerik:RadPanelbar ID="rpbContactType" runat="server" Width="100%" ExpandMode="FullExpandedItem" Height="275" >
            <Items>
                <telerik:RadPanelItem Text="Address Book" Value="MainRadPanel"  Expanded="true" Selected="true">
                    <Items>
                        <telerik:RadPanelItem Value="AddressBook">
                            <ItemTemplate>
                             
                              <telerik:RadGrid ID="rgAddressBook" runat="server" Width="100%" Height="225" AllowMultiRowSelection="true" >
                                    <ClientSettings EnableRowHoverStyle="true" AllowDragToGroup="false" AllowGroupExpandCollapse="false">
                                        <Scrolling AllowScroll="True" UseStaticHeaders="true" ScrollHeight="225" />
                                            <Selecting AllowRowSelect="true" />
                                    </ClientSettings>
                                    <MasterTableView AutoGenerateColumns="false"  CommandItemDisplay="None" ClientDataKeyNames="ID, Address" DataKeyNames="ID, Address">
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="ID" Display="false" UniqueName="ID"></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="AddressName" HeaderText="Name" HeaderStyle-Width="150" ItemStyle-Width="150" ></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Address" HeaderText="Address"></telerik:GridBoundColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                             
                           </ItemTemplate>
                           </telerik:RadPanelItem>
                            
                           </Items>
                          </telerik:RadPanelItem>
                     </Items>
                      
                  </telerik:RadPanelbar>
                   
                   
         <telerik:RadTreeView ID="rtvCategories" runat="server"
            Width="100%"
            Height="125"
            CheckBoxes="true"
            CheckChildNodes="true"
            MultipleSelect="false"
            BorderStyle="None"
            BorderWidth="1px"
           OnClientNodeClicking = "clientNodeClicking"
            OnClientNodeChecking = "clientNodeChecking"
            >
 
             <Nodes>
                <telerik:RadTreeNode Value="0" Text="First Item" />
                <telerik:RadTreeNode Value="1" Text="Second Item" />
            </Nodes>
        </telerik:RadTreeView>
         
         
    </div>
    </form>
</body>
</html>

Public rgAddressBook As Telerik.Web.UI.RadGrid
    Private _IDSelected As Integer = 0
    Private Sub StatusNotificationsTest_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        rgAddressBook = rpbContactType.FindItemByValue("MainRadPanel").Items.FindItemByValue("AddressBook").FindControl("rgAddressBook")
    End Sub
 
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
        If Page.IsPostBack = False Then
            rgAddressBook.DataSource = GetRadGridData(_IDSelected)
        End If
    End Sub
 
    Protected Sub rgAddressBook_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)
        rgAddressBook.DataSource = GetRadGridData(_IDSelected)
    End Sub
 
    Private Function GetRadGridData(ByVal ItemSelected As Integer) As DataTable
        GetRadGridData = New DataTable
        With GetRadGridData
            .Columns.Add("ID", GetType(Integer))
            .Columns.Add("AddressName", GetType(String))
            .Columns.Add("Address", GetType(String))
        End With
 
        Dim NewRow As DataRow = GetRadGridData.NewRow
        Select Case ItemSelected
            Case 0
                NewRow("ID") = "0"
                NewRow("AddressName") = "John Doe"
                NewRow("Address") = "johndoe@test.com"
            Case 1
                NewRow("ID") = "1"
                NewRow("AddressName") = "John Smith"
                NewRow("Address") = "Johnsmith@test.com"
        End Select
        GetRadGridData.Rows.Add(NewRow)
    End Function
 
 
    Protected Sub ramNotification_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles ramNotification.AjaxRequest
        Dim argument As String = e.Argument
        _IDSelected = argument
        rgAddressBook.Rebind()
    End Sub

Is there an example somewhere for something similar?
Dimitar Terziev
Telerik team
 answered on 05 Apr 2011
2 answers
98 views
How RadEditor Design, HTML, Preview button text rename?
sangki
Top achievements
Rank 1
 answered on 05 Apr 2011
3 answers
466 views
<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    Codebehind="ManageFAQsNew.aspx.cs" Inherits="TRAC.Connect.WebSite.ManageFAQsNew"
    Title="TRAC Connect :: Manage FAQs" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Src="Caption.ascx" TagName="Caption" TagPrefix="cap" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MasterContentPlaceHolder" runat="server">
    <asp:Panel ID="HeightAdjusterPanel" runat="server" Height="660" Width="98%">
        <cap:Caption ID="MyCaption" runat="server" CaptionText="Manage FAQs" />
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
        </telerik:RadWindowManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="radGridManageFAQs">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="radGridManageFAQs" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="20"
            MinDisplayTime="20">
        </telerik:RadAjaxLoadingPanel>
          <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function PopUpShowing(sender, eventArgs) {
                                    var popUp = eventArgs.get_popUp(); 
                                    var popUppopUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px")); 
                                    var popUppopUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px")); 
                                    var windowHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight); 
                                    var windowWidth = document.body.offsetWidth; 
                                    if (popUppopUpHeight == "") popUppopUpHeight = 300; // if the height isn't set on the popup, default to 300px    
                                    popUp.style.position = "fixed"; 
                                    popUp.style.left = (Math.floor((windowWidth - popUppopUpWidth) / 2)).toString() + "px"; 
                                    popUp.style.top = (Math.floor((windowHeight - popUppopUpHeight) / 2)).toString() + "px"; 
                
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadGrid ID="radGridManageFAQs" runat="server" AutoGenerateColumns="False"
            PageSize="15" AllowSorting="True"  ShowStatusBar="True" AllowMultiRowEdit="true"
            OnNeedDataSource="radGridManageFAQs_DataSource">
            <MasterTableView CommandItemDisplay="TopAndBottom" TableLayout="Fixed" EditMode="PopUp"
                DataKeyNames="FaqId,FaqPosition,Category">
                <NoRecordsTemplate>
                    <div>
                        There are no records to display
                    </div>
                </NoRecordsTemplate>
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldName="CategoryCode.Description" HeaderText="Category"
                                FieldAlias="CategoryCode.Description" />
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="CategoryCode.ResultPosition" FieldAlias="CategoryCode.ResultPosition" />
                            <telerik:GridGroupByField FieldName="CategoryCode.Description" FieldAlias="CategoryCode.Description" />
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" FilterControlAltText="Filter EditCommandColumn column"
                        EditImageUrl="~/images/Edit.bmp">
                        <HeaderStyle Width="20px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="FaqId" Display="False" HeaderText="Faq Id" UniqueName="FaqId"
                        FilterControlAltText="Filter FaqId column" />
                    <telerik:GridBoundColumn DataField="FaqPosition" Display="False" UniqueName="FaqPosition"
                        HeaderText="Faq Position" FilterControlAltText="Filter FaqPosition column" />
                    <telerik:GridBoundColumn DataField="CategoryCode.Description" Display="False" UniqueName="Desc"
                        HeaderText="Category Description" FilterControlAltText="Filter Desc column" />
                    <telerik:GridBoundColumn DataField="CategoryCode.ResultPosition" Display="False"
                        HeaderText="Category ResultPosition" UniqueName="ResPos" FilterControlAltText="Filter ResPos column" />
                    <telerik:GridBoundColumn DataField="Text" HeaderText="FAQ Text" UniqueName="Text"
                        FilterControlAltText="Filter Text column" Display="false">
                        <HeaderStyle Width="300px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Category" HeaderText="Category" Display="False"
                        UniqueName="Category" FilterControlAltText="Filter Category column" />
                    <telerik:GridBoundColumn DataField="Subject" HeaderText="Subject" UniqueName="Subject"
                        FilterControlAltText="Filter Subject column">
                        <HeaderStyle Width="600px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Author" HeaderText="Author" UniqueName="Author"
                        FilterControlAltText="Filter Author column">
                        <HeaderStyle Width="50px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DateCreated" HeaderText="DateCreated" UniqueName="DateCreated"
                        Display="False" FilterControlAltText="Filter DateCreated column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ExpirationDate" HeaderText="Expiration Date"
                        UniqueName="ExpirationDate" FilterControlAltText="Filter ExpirationDate column">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this user?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                        UniqueName="DeleteColumn" FilterControlAltText="Filter DeleteColumn column" ImageUrl="~/images/Delete.bmp">
                         <HeaderStyle Width="30px" />
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings EditFormType="WebUserControl" UserControlName="FAQEditor.ascx"
                    PopUpSettings-Modal="true" PopUpSettings-Width="900" InsertCaption="Add New FAQ"
                    CaptionFormatString="Edit FAQ">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <CommandItemSettings ExportToPdfText="Export to Pdf" AddNewRecordText="Add New FAQ" />
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
             
        </telerik:RadGrid>
    </asp:Panel>
</asp:Content>

Attached sceenshots and code above.

If i remove Grid Client Settings. Popup Box shows correctly but i can't adjust scroll for my grid and grid grouping option.

Let me know what I am doing wrong.

Thanks,
Maria Ilieva
Telerik team
 answered on 05 Apr 2011
1 answer
95 views
I have 8 items in my legend and it is reusing colors , it seems like there are only 6 colors by default with the built in skins. How can I add my own colors for the chart?  I am using a Pie chart.

Thanks!
Sia
Telerik team
 answered on 05 Apr 2011
1 answer
68 views
i just purchased the Telerik Developer tools and wanted to add the RadMenu control (or something equivalent to it) into an existing Classic ASP web site.  That's classic ASP site with .asp pages. 

Can I use the Rad Menu control for this?  If not. are there any other Telerik controls that can be used?

Are there instructions anywhere to do this. 

Thanks for your assistance.
Shinu
Top achievements
Rank 2
 answered on 05 Apr 2011
1 answer
98 views

hello.

I'm using Asp.Net Ajax 2010 Q3 edition,

On the page i have RadMenu and RadGrid with PopUp edit form.

The problem is that when i move grid popup form over the menu, the menu hovers it, despite of that my popup is modal. (see the file)

Is this any bug or something?

Is there any solution?

thx.

Shinu
Top achievements
Rank 2
 answered on 05 Apr 2011
1 answer
87 views
I have a webforms app containing a paged gridview (e.g., 200 records - 50 rows and 4 pages).

When the user clicks on a button in a specific row of the grid (e.g., row 20 of the 4th page), another web page is launched to process that button click. When the user closes that page to return to the main gridview, the gridview databind event is rerun which redisplays the gridview starting at the item 1 on page 1.

However, I want to have the previous position maintained, so that the grid will automatically be scrolled to the the previously clicked gridview page and item.

How would I accomplish this?
Shinu
Top achievements
Rank 2
 answered on 05 Apr 2011
4 answers
99 views
Hi....

I want to Export the RadGrid datas to pdf .... But the problem is "Say if my grid contain value of 10 and if i set the page size to 5... only the visible 5 data only generated as pdf, but i want the second page value too(remaining 5 data)... could any one help with this thing.... please

Thanks in advance..

Regards
Suren
$uren
Top achievements
Rank 1
 answered on 05 Apr 2011
2 answers
83 views
Hello Telerik Team,

Need your help, Is it possible to use "Datapager with RadDataGrid ".
 
Please let us know so that we can continue to use it.

Regards
Sudhakar
sudhakar
Top achievements
Rank 1
 answered on 05 Apr 2011
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?