Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
187 views
We have been using RadToolbar for a very long time, but until recently we had never used the ItemTemplate functionality.

While we can display the templates correctly, we are encountering a significant issue when the page is posted back: the templates are not rendered after postback completes.

After a significant amount of troubleshooting, we have tracked the issue down to dynamically added buttons. We have static templates for most toolbars (defined in a skin), but there are several cases where we need to dynamically add buttons to every toolbar rather than adjusting all of the skins.

As soon as we insert a new toolbar item after the templated items, the templated items will no longer render after a postback (we have not tried inserting before because that is not something that we need to do.

We have tried removing and re-adding the dynamic toolbar items and simply ignoring them if they already exist on a postback, but in both cases, the templated items are not rendered.

I have a sample project that demonstrates the issue, but am not allowed to attach it to this thread.
Princy
Top achievements
Rank 2
 answered on 29 May 2014
1 answer
102 views
Hi,

My asp.net radscheduler loads custom appointments from an SQL Server database. I implemented the OnClientAppointmentMoveEnd (It calls a PageMethod to update the database) method to update the appointment when moving the appointment from one slot to another. Sometimes, not always, when i move the appointment, it moves back to the original slot, without showing errors. I´ve debbuged the code , and saw no errors. Could you help me with that?

Asp.net Version: 3.5
Telerik Version: 2013.1.417.35


Plamen
Telerik team
 answered on 29 May 2014
2 answers
108 views
Good day!

In the code snippet below I'm always getting RadListView1.SelectedValue from previous ViewState at Page_Load handler.
For example, when I press "3" in the listview, I get "" in LabelRadListView1SelectedValue. Next time I press "5" and get "3" and so on.

Why "RadListView1.SelectedValue" isn't actual at Page_Load event on PostBack?
For example, It's going well at Page_LoadComplete event. So why RadListView1 restored from ViewState after Page_Load event?
I'm confused. Please, help!

RadListVew.aspx:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="RadListView.aspx.cs" Inherits="RadListV" %>
 
<%@ Import Namespace="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadListView runat="server" ID="RadListView1" ItemPlaceholderID="PlaceHolderListContainer" DataKeyNames="data">
        <LayoutTemplate>
            <asp:PlaceHolder ID="PlaceHolderListContainer" runat="server"></asp:PlaceHolder>
        </LayoutTemplate>
        <ItemTemplate>
            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Select">
                <asp:Label runat="server" ID="Label1" Text='<%#Eval("data")%>' />
            </asp:LinkButton>
        </ItemTemplate>
        <SelectedItemTemplate>
            <span style="font-weight: bold;">
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Select">
                    <asp:Label runat="server" ID="Label1" Text='<%#Eval("data")%>' />
                </asp:LinkButton>
            </span>
        </SelectedItemTemplate>
    </telerik:RadListView>
 
    <div>
        <asp:Label runat="server" ID="LabelRadListView1SelectedValue" />
    </div>
</asp:Content>


RadListVew.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using Telerik.Web.UI;
 
public partial class RadListV : System.Web.UI.Page
{
    class ListItem
    {
        public int data { get; set; }
    }
 
    List<ListItem> ListDataSource
    {
        get
        {
            return (List<ListItem>)Session["ListDataSource"];
        }
 
        set { Session["ListDataSource"] = value; }
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (RadListView1.SelectedValue != null)
        LabelRadListView1SelectedValue.Text = RadListView1.SelectedValue.ToString();
    }
 
    protected void Page_Init(object sender, EventArgs e)
    {
        ListDataSource = new List<ListItem>();
        for (int i = 1; i < 5; i++)
        {
            ListDataSource.Add(new ListItem { data = i });
        }
        RadListView1.DataSource = ListDataSource;
    }
}




zDog
Top achievements
Rank 1
 answered on 29 May 2014
4 answers
346 views
Hi,

I am trying to get a RadDropDownList to work within a RadGrid. Autogeneratecolumns are set to False and all columns have been set.

The first code snippet is the column I am having issues with. The second code snippet is the same column but doesn't offer the DropDownList feature.
Basically what I am trying to archive, is when a user is looking at the grid, they can easily change the "Team" without the need going to Edit > (Change record) > Update.

​<telerik:GridTemplateColumn>                  <ItemTemplate>                                               <telerik:RadDropDownList DataField="IDNO" DataSourceID="TeamFilterOptions"                                                  HeaderText="123" DataTextField="FieldAnswer"                                                   UniqueName="DocCategoryColumn3" runat="server" ID="ddlEditCategory" AutoPostBack="True"></telerik:RadDropDownList>                  </ItemTemplate>              </telerik:GridTemplateColumn>
 
 
 
 
 



<telerik:GridBoundColumn DataField="Team" HeaderText="Team" UniqueName="Team">                                            <FilterTemplate>                                               <telerik:RadComboBox ID="RadListBoxTeam" DataSourceID="TeamFilterOptions" DataTextField="FieldAnswer"                            DataValueField="FieldAnswer" Height="200px" AppendDataBoundItems="true" SelectedValue='<%# TryCast(Container,GridItem).OwnerTableView.GetColumn("Team").CurrentFilterValue %>'                            runat="server" OnClientSelectedIndexChanged="TeamIndexChange">                            <Items>                                <telerik:RadComboBoxItem Text="All" />                            </Items>                        </telerik:RadComboBox>                         <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">                            <script type="text/javascript">                                function TeamIndexChange(sender, args) {                                    var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID%>");                                    tableView.filter("Team", args.get_item().get_value(), "EqualTo");                                }                            </script>                        </telerik:RadScriptBlock>                    </FilterTemplate>                </telerik:GridBoundColumn>





My issues I am facing are 
How do I get the item to display the correct text as it just displays the first record from the data source. i.e. pull the data from the RadGrid datasource, the DataTextField should get the "Team" field. When I try to bind the data it just says "System.Data.DataRowView".
Once the user changes the value from the Drop Down List how do I retrieve that value in the code behind (VB.net but C# is fine), I cannot find anything relating to CommandName?

Thanks,
Alex



Shinu
Top achievements
Rank 2
 answered on 29 May 2014
1 answer
91 views
I have a radgrid which contains 4 columns,when i press tab on search filter the focus of cursor should go on next radgrid column filter ideally,but this is not happeing at my side .I have attached gif file .Please have a look at it .


Please Suggest.
Eyup
Telerik team
 answered on 29 May 2014
1 answer
93 views
Hi,

I am currently developing a website with Radgrid in it.
I want to print the rows that the user has chosen (all of the rows from all pages).
(http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-on-sorting.html)

Please help me with the following:
1. printing all selected items.
2. after printing, the grid should display exactly as before (and not change do the print setting).


Thanks,
Daniel
Eyup
Telerik team
 answered on 29 May 2014
1 answer
117 views
I have created dynamic rad grid and implementing paging on it .but if i change the page size grid is refreshing and hiding the paging option as well as the controls on page will hide.

Pls help
attaching the screen shot pls help this is something very urgent.
Princy
Top achievements
Rank 2
 answered on 29 May 2014
6 answers
344 views
Hi ,

I need to display a grid with two headers where the top header gives the text and the bottom header displays a dropdownlist when auto generate Columns set to true.I have a checkbox column  too.I need to display dropdowns on grid headers. Please help me out.

Thanks in advance
Shinu
Top achievements
Rank 2
 answered on 29 May 2014
1 answer
518 views
Hi
I have this code:

<MasterTableView CommandItemDisplay="Top">
                        <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowExportToPdfButton="true" />

and the  ShowAddNewRecordButton="false" works fine, but the ShowExportToExcelButton="true" is not doing anything. It doesn't cause a crash, however no export to excel button shows up in the CommandDisplay.

What am I doing wrong here?

I am using version 2014.1.403.45 of telerik
Princy
Top achievements
Rank 2
 answered on 29 May 2014
1 answer
97 views
Hi,

I would like to center all columns of RadGrid on the screen display as well as on pdf export of the file. How can I do that? I tried many techniques but didnt see anything happening for example:

gridview.MasterTableView.GetColumn("column").HeaderStyle.HorizontalAlign = HorizontalAlign.center

but without any success.

Any suggestions on that??? thanks
Princy
Top achievements
Rank 2
 answered on 29 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?