Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
172 views
Hi,

I´m making a custom Sitefinity control and I have some problems getting the RadListView and RadDataPager to function with the AjaxManagerProxy. I think I need to set the AjaxManager in code behind due to sitefinity,  but I can´t get it to work properly. The control loads with 3 paging buttons and if I click on number 2, button number 3 disapears. Also, I don´t think all the rows in the NeedDataSource gets loaded, or at least the paging don´t seem to know about it. Any ideas?

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
</telerik:RadAjaxManagerProxy>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
  
<div class="localEventContainer">
    <asp:Panel ID="ListViewPanel" runat="server">
    <div class="localEventTop"><asp:Label ID="lblControlTitle" runat="server"></asp:Label></div>
        <telerik:RadListView ID="RadListView1" runat="server" AllowPaging="True" 
            DataKeyNames="EventID" ItemPlaceholderID="EventItemContainer"
            Skin="Black" OnDataBound="RadListView1_DataBound" 
            OnNeedDataSource="RadListView1_NeedDataSource">
            <LayoutTemplate>
                <asp:Panel ID="EventItemContainer" runat="server"></asp:Panel>
                <table cellpadding="0" cellspacing="0" width="100%;" style="clear: both;">
                    <tr>
                        <td>
                            <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListView1"
                                PageSize="5">
                                <Fields>
                                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                    <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                    <telerik:RadDataPagerButtonField FieldType="NextLast" />
                                </Fields>
                            </telerik:RadDataPager>
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
            <div class="localEventArticleContainer">
                <div class="localEventTitle">
                    <asp:Label ID="lblEventName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                </div>
                <div class="localEventDate">
                    <asp:Label ID="lblDate" runat="server" Text='<%# Eval("Date", "{0:d}") %>'></asp:Label>
                    <asp:Label ID="lblTime" runat="server" Text='<%# Eval("Starttime") %>'></asp:Label>
                </div>
                <div class="localEventText">
                    <asp:Label ID="lblText" runat="server" Text='<%# Eval("LocationName") %>'></asp:Label>
                </div>
                <%--<div class="localEventLink">
                    <asp:HyperLink ID="lblLink" runat="server" Text="Ticnet.se" NavigateUrl='<%# Eval("Url") %>' Target="_blank"></asp:HyperLink>
                </div>--%>
            </div>
            </ItemTemplate>
        </telerik:RadListView>
    </asp:Panel>
      
    <div class="localEventBottom"></div>
</div>
protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        if (this.Page != null && !this.DesignMode)
        {
            RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(this.Page);
            if (ajaxManager != null)
            {
                ajaxManager.AjaxSettings.AddAjaxSetting(ListViewPanel, ListViewPanel, RadAjaxLoadingPanel1);
            }
  
            lblEventAreaID.Text = EventAreaID.ToString();
        }
    }

protected void RadListView1_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
    {
        RadListView1.DataSource = ReadData("SELECT e.EventID, e.Name,e.Url, ev.Name AS LocationName, et.Date, et.Starttime FROM mp_Event e INNER JOIN mp_EventLocation ev ON e.EventLocationID = ev.EventLocationID INNER JOIN mp_EventTime et on e.EventID = et.EventID WHERE " + "ev.AreaID = @AreaID AND " + "et.Date >= '" + Today + "' ORDER BY Date ASC");
    }
  
    private SqlDataReader ReadData(string query)
    {
        string connString = ConfigurationManager.ConnectionStrings["UnigolfMPTestConnectionString"].ConnectionString;
        conn = new SqlConnection(connString);
        conn.Open();
  
        SqlCommand cmd = new SqlCommand(query, conn);
        cmd.Parameters.AddWithValue("@AreaID", lblEventAreaID.Text);
  
        reader = cmd.ExecuteReader();
        return reader;
    }
  
    protected void RadListView1_DataBound(object sender, EventArgs e)
    {
        reader.Close();
        conn.Close();
    }
Johnny
Top achievements
Rank 1
 answered on 08 Feb 2011
1 answer
80 views
Hi,
How can I pass a parameter to in javascript request of RadAjax and get it in form_Load of page?
Shinu
Top achievements
Rank 2
 answered on 08 Feb 2011
13 answers
233 views
Hi

I am using Telerik:RadListbox in which i have to to show one item as disabled. Now I should always show the disable item at the top and should prompt the user tht disabled item will be the first item always.

Please let me know how to achieve this functionality.

Thanks in advance.
Kate
Telerik team
 answered on 08 Feb 2011
1 answer
124 views
Hi.

I'm using the RadContextMenu with an MVC Grid. I managed to create and display the menu when the grid is right clicked, but what I can't do is hide the menu when I click on another row in the grid. Is there a way to hide the menu when the user clicks outside any of its items?

Thanks in advance.
Kate
Telerik team
 answered on 08 Feb 2011
1 answer
113 views
hi team,

 the cells are not properly aligned in day/week/month views in  Motorola Xt-720 Tablet.


do you have any solution for this ?




Thanks in advance...

with regards,
Ganesh.A
ganesh
Top achievements
Rank 2
 answered on 08 Feb 2011
2 answers
175 views
Hi,

I have created a RadMenu in a RadGridTemplate column so that each row will have a RadMenu. I need to view/hide that RadMenu items acording to the permission.

What i did is I try to find the RadMenuItem in Grid_ItemDataBound event of the grid.

First I use  "FindItemByText" method. It works well.
  
 var radMenuMission = item.FindControl(RadMenuName) as RadMenu;                  
  
if (radMenuMission != null)                     {
     var radMenuItem = radMenuMission.FindItemByText(
"Delete");

But the problem is Text property is changed according to localized resources.
in that way Finding the RadMenuItem by Text is failed.

I need to use "FindItemByValue" method. I set "Value" attribute of the  RadMenuItem still i cant Find the menu Item. 

When I see the html code of the browser the Value property is missing.

Can anybody help for this ?

Thank you,

Dinesh
Dinesh
Top achievements
Rank 1
 answered on 08 Feb 2011
1 answer
103 views
Hi, I currently have my RadGrid setup with DetailTables, but I would like to switch to NestedView to have more control over the presentation of the data.  For my Detailtables I useOnDetailTableDataBind, but the NestedView doesn't have that property.  What is the best route take if I have a datasource that can only be generated programmatic?

<telerik:RadGrid ID="RadGrid1" runat="server"
    AllowSorting="True" GridLines="None" ShowGroupPanel="True"
    OnNeedDataSource="RadGrid1_NeedDataSource"
    OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
    AllowFilteringByColumn="True">
    <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView  DataKeyNames="ID" AllowMultiColumnSorting="True">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="ID"  Width="100%"
                runat="server" AutoGenerateColumns ="false">
                <Columns>
                    <telerik:GridBoundColumn SortExpression="Joined" HeaderText="Joined" HeaderButtonType="TextButton"
                        DataField="Joined" UniqueName="Joined">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Status" HeaderText="Status" HeaderButtonType="TextButton"
                        DataField="Status" UniqueName="Status">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="City" HeaderText="City" HeaderButtonType="TextButton"
                        DataField="City" UniqueName="City">
                    </telerik:GridBoundColumn>
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
        <NestedViewSettings>
         
        </NestedViewSettings>
    </MasterTableView>
</telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 08 Feb 2011
6 answers
192 views
Hi all,

I noticed that my dynamically created dock zones were falling outside of their container. I added a static dock zone and noticed that it too falls outside of this container. I'm at a loss.

<telerik:RadSplitter ID="RadSplitter1" Runat="server"
                 Width="100%" BorderSize="2" OnClientLoad="OnSplitterLoaded"
                BackColor="White" CssClass="RoundedStyle" Height="600px" Skin="Web20" >
                    <telerik:RadPane ID="RadPane1" Runat="server" Scrolling="None" Width="20px"
                        BackColor="#6086C1" >
                        <telerik:RadSlidingZone ID="RadSlidingZone1" Runat="server" ClickToOpen="True"
                            BackColor="#6086C1" Width="20px" Skin="Web20" >
                            <telerik:RadSlidingPane ID="RadSlidingPane1" Runat="server" Title="Settings"
                                Scrolling="Y" MinWidth="160"
                                Width="160px" BackColor="#ECF4FD" >
                                <telerik:RadListBox ID="lstBxSettings" runat="server" Skin="Web20"
                                    EnableDragAndDrop="True" ondropped="LstBxSettings_Dropped" Width="100%"
                                    style="top: 0px; left: 0px">
                                    <ButtonSettings TransferButtons="All" />
                                    <Items>
                                        <telerik:RadListBoxItem ListBox="lstBxSettings" Text="Horizontal Bar" />
                                        <telerik:RadListBoxItem ListBox="lstBxSettings" Text="Vertical Bar" />
                                    </Items>
                                </telerik:RadListBox>
                            </telerik:RadSlidingPane>
                            <telerik:RadSlidingPane ID="RadSlidingPane2" Runat="server" Title="Custom"
                                Scrolling="Y" MinWidth="160" BackColor="#ECF4FD">
                                <telerik:RadListBox ID="lstBxCustom" runat="server"
                        EnableDragAndDrop="True" ondropped="RadListBox_Dropped" Skin="Web20" Sort="Ascending"
                                    Width="100%">
                                    <ButtonSettings TransferButtons="All" />
                                </telerik:RadListBox>
                            </telerik:RadSlidingPane>
                            <telerik:RadSlidingPane ID="RadSlidingPane3" Runat="server" Title="Historical"
                                Scrolling="Y" MinWidth="160" Width="160px" BackColor="#ECF4FD" >
                                <telerik:RadListBox ID="lstBxHistorical" runat="server"
                        EnableDragAndDrop="True" ondropped="RadListBox_Dropped" Skin="Web20" Sort="Ascending"
                                    Width="100%">
                                </telerik:RadListBox>
                            </telerik:RadSlidingPane>
                        </telerik:RadSlidingZone>
                    </telerik:RadPane>
                    <telerik:RadPane ID="RadPane2" Runat="server" MinHeight="500"
                        BorderColor="White" Scrolling="None" CssClass="RoundedStyle">
                    </telerik:RadPane>
                </telerik:RadSplitter>

I thought it might be the fact that I had Pane1 on the LHS of my RadSplitter. I set its visibility to false, but the dockzone just grew in size and continued hanging over one edge. 

RadPane2's width is unset and the DockZone is housed inside of this. Could this be the problem? If so, what would a good solution be? I can't set the width in percentage, but that's what I would like to be doing. In addition, when inspecting the elements on the web page I found the width of RadPane2 to be correct.

The attached picture shows where the rounded corner looks fine inside the dockzone on the LHS, but because the dockzone extends too far on the RHS it gets chopped off. I also show the HTML markup where it is clear that the the RadPane is 1013 px (the width of the RadSplitter), but then the 100% width of the DockZone it is containing expands past it.

Thanks for your time,

Sean

EDIT: Sorry, there was something weird going on with my attachments. The image labeled "ActuallyCorrect.png" should be reflective of what I stated above.
Sean
Top achievements
Rank 2
 answered on 08 Feb 2011
1 answer
130 views
Hi,

I'm experimenting with using the ASP.NET AJAX RadScheduler in an MVC project which so far I have managed to implement with some rudimentary functionality and like what I see. We already have a middle tier which exposes schedule data via a WCF service returning what are essentially DTOs. I have seen examples of using a webservice that then talks to a data provider on the server and I see from this post:

http://www.telerik.com/community/forums/aspnet-ajax/scheduler/data-providers-and-web-services.aspx

that although it's possible to avoid writing a data provider the complications involved mean it probably makes the most sense to just implement a provider. Ideally I'd like to be able to simply invoke our WCF service from the client side and have the RadScheduler utilize the DTO instances returned. The DTO we return can be shaped to fit whatever the RadScheduler needs. Is this possible? I do see that there is the DataSource property where you can bind to an IEnumerable but it looks like that may not work in an MVC project and requires server side methods.

It may be feasible for us to have our WCF service invoke a custom data provider that simply then executes our normal code path from the custom RadScheduler data provider this then would look much like your WebService examples. I understand the data provider pattern and I like that you have used this approach but I was hoping to understand a little better what the WebServiceAppointmentController does before I go down this path. It does mean some complications because we have change tracking and other mechanisms in place to facilitate simply passing DTOs around for CRUD operations so mapping to your Appointment types means a lot of mapping between types etc.

Also, if you have any other suggestions for an approach given what I've described of our architecture, I'd appreciate your thoughts.

Thanks!
Kalina
Telerik team
 answered on 07 Feb 2011
2 answers
95 views
Hello,

       Anybody know if there is a way for me to use the RadNumericTextBox in Random Steps.

For example:

The textbox should take only these values: 0,  10, 55, 77, 90.

If RadNumericTextBox cannot be used, What are my alternatives other than using a combobox?

Sundeep
Sundeep Nadendla
Top achievements
Rank 1
 answered on 07 Feb 2011
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?