Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
224 views
Hello All,

Presently I am having a telerik radgrid with a commanditem template above the grid header for some extra  information.But the problem is that while exporting to CSV , the header information inside the commandItem template is not being exported.However the export is working just fine with PDF and Excel .Here is the code I am using.


 <telerik:RadGrid ID="ModifiedContentsReportGrid" runat="server" AutoGenerateColumns="false"
                AllowSorting="true" AllowPaging="true" EnableOutsideScripts="true" PagerStyle-Mode="NextPrevAndNumeric"
                ShowFooter="true" OnItemCreated="ModifiedContentsReportsGrid_OnItemCreated" Title="Modified Content Report"
                Height="100%" ExportSettings-ExportOnlyData="false" 
                EnableViewState="true">
                <ItemStyle BackColor="transparent" />
                <AlternatingItemStyle BackColor="#F9F9F9" />
                <ExportSettings OpenInNewWindow="true" FileName="Modified Content Report" ExportOnlyData="false" >
                    <Pdf PaperSize="A4" AllowPrinting="true" PageBottomMargin="10px" PageTopMargin="25px"
                        PageHeaderMargin="0px" PageLeftMargin="10px" PageRightMargin="10px" PageTitle="Modified Content Report" />
                </ExportSettings>
                <HeaderStyle HorizontalAlign="Center" />
                <ClientSettings>
                    <Scrolling UseStaticHeaders="true" />
                </ClientSettings>
                <MasterTableView Width="100%" CommandItemDisplay="Top" CommandItemStyle-HorizontalAlign="Right"
                    TableLayout="Fixed">
                    <CommandItemTemplate>
                        <asp:Literal runat="server"><b>Account Name :</b></asp:Literal>
                        <asp:Label ID="lblClientName" runat="server" /><br />
                        <asp:Literal runat="server"><b>Report generated on :</b></asp:Literal>
                        <asp:Label ID="lblGenerateDate" runat="server" /><br />
                        <asp:Literal runat="server"><b>Date Range :</b></asp:Literal>
                        <asp:Label ID="lblDateRange" runat="server" />
                    </CommandItemTemplate>
                    <Columns>
                        <telerik:GridBoundColumn DataField="Name" SortExpression="Name" HeaderText="Content File"
                             SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
                            ItemStyle-Width="30%">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Location" SortExpression="Location" HeaderText="Location"
                            SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
                            ItemStyle-Width="30%">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Project/Folder" SortExpression="Project/Folder"
                            HeaderText="Project/Folder" SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
                            ItemStyle-Width="10%">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Document" SortExpression="Document" HeaderText="Document"
                            SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
                            ItemStyle-Width="10%">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Section" SortExpression="Section" HeaderText="Section"
                            SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
                            ItemStyle-Width="10%">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="JobNumber" SortExpression="JobNumber" HeaderText="Job Number"
                            SortAscImageUrl="/Images/SortAsc.gif" SortDescImageUrl="/Images/SortDesc.gif"
                            ItemStyle-Width="10%">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <NoRecordsTemplate>
                        <asp:Literal runat="server">
                    No records to display.</asp:Literal>
                    </NoRecordsTemplate>
                </MasterTableView>
                <PagerStyle Mode="NextPrevAndNumeric" />
            </telerik:RadGrid>

Can anyone provide some some inputs or solution to this problem?

Maria Ilieva
Telerik team
 answered on 19 Mar 2015
5 answers
613 views
I have form designer that allows users to create any form they want the will then be used as a member form.  The member form is then used to join a group.  All this is working fine (except for a problem with RadDropDownList) and I have many members in the test database.  I now wish to use the grid to display the users in a group member list for member management.

The problem I cannot solve is how to create the source with data for the grid.  Every example I can find seems to know all its columns in advance.  I actually do not know any of my columns in advance.  I have a list of form rows that each have a name with a type and the ability to populate instances of the list. 

I would also like to create a column selector. I wonder if there are any examples of that around.

Thanks,
George
Eyup
Telerik team
 answered on 19 Mar 2015
9 answers
478 views
I am getting this exception intermittently when binding a RadListView. I create a data table, fill it with some data, assign it as the data source, and then do a data bind. I know the code always returns a data table, even if it is empty, so this error can't be caused by a null data source. Could it be caused by something else, maybe one of the fields in the item template?

Here's the stack trace:
at Telerik.Web.UI.ListViewNullEnumerable.get_DataSourceCount() 
at Telerik.Web.UI.RadListView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) 
at Telerik.Web.UI.RadListView.PerformDataBinding(IEnumerable data) 
at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) 
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) 
at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at Telerik.Web.UI.RadListView.PerformSelect() 
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.RadListView.DataBind() 

Here's my HTML code:
<telerik:RadListView ID="RadListView1" runat="server" Width="100%" AllowPaging="true" ItemPlaceholderID="StylesHolder" DataKeyNames="StyleNumber" OnPageIndexChanged="RadListView1_PageIndexChanged">
    <LayoutTemplate>
        <fieldset style="width: 100%; border: none;" id="FieldSet1">
            <asp:Panel ID="StylesHolder" runat="server">
            </asp:Panel>
        </fieldset>
    </LayoutTemplate>
    <ItemTemplate>
        <div class="grid_3 SearchResults_Container">
            <a href="#" onclick="DetailClick('<%# Eval("StyleNumber") %>')">
                <%-- This div is necessary in that 'relative' is required in a div before 'absolute' is used in next dic --%>
                <div class="SearchResults_ImageContainer">
                    <%-- This div forces image to be vertical-aligned at bottom, just above text, but centered. --%>
                    <div class="SearchResults_ImageAlignment">
                        <%# GetStylePrimaryImage(Eval("StyleNumber") as string) %>
                    </div>
                </div>
                <%# Eval("StyleNumber") %><br />
                <%# Eval("ProductName") %>
            </a>
        </div>
    </ItemTemplate>
</telerik:RadListView>
Maria Ilieva
Telerik team
 answered on 19 Mar 2015
3 answers
344 views
I have 2 levels TabStrip.
Last item on 1st level is Help

                <telerik:RadTab Text="Help" NavigateUrl="http://www.google.com" Target="_blank">
                </telerik:RadTab>

I want to user stay on current tabs when he/she clicks "Help" tab. 
Currently browser opens new window but selects Help empty page. 

Could you guide me how to achieve that behavior.

thanks.
Ivan Danchev
Telerik team
 answered on 19 Mar 2015
2 answers
616 views
I'm trying to personalize the clienttemplate, formatting numbers, and putting percentage

For a stacked 100% bar chart I have the following:

series.TooltipsAppearance.ClientTemplate = "#= dataItem.categoryName#<br/>#= dataItem.categoryValue#";

It works perfectly, but I want to display only three decimals for categoryValue.

If I try to add kendo.format(...), as I see in some example online, the chart is not shown anymore...

I'd like to show also the percentage of category value (the chart is a stack100 type)
marco
Top achievements
Rank 2
 answered on 19 Mar 2015
1 answer
111 views
Hello,

I am working on a project that uses RadControls for "ASP.NET AJAX Q2 2009 SP1" and I would like to upgrade to the latest version of "UI for ASP.NET AJAX" which my company has just purchased.

As the two versions are so far apart can anyone tell me of any pitfalls I may encounter?

Should I just setup a test development environment and "suck it and see"??

Thanks,

Mark.
David
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 19 Mar 2015
1 answer
84 views
In a fairly narrow RadGrid, PagerStyle is set to Slider, but the slider bar is so wide that when you go to a new page, the Page X of Y label overwrites the Items X to Y of Z label. 

How can the width of the slider bar be defined so as to prevent this?  I was able to programmatically set it via some JavaScript, but the amount the selector moves per page is off and when you get to Page Y of Y, it still overwrites the Next Page button

The basic issue is in the attached image
Venelin
Telerik team
 answered on 19 Mar 2015
2 answers
131 views
Is there a way to expand the nodes on mouse over without clicking?
Tina
Top achievements
Rank 2
 answered on 19 Mar 2015
3 answers
270 views
Hello,

I've a problem with overlapping appointments. When filtering appointments with three employers, there is no problem. But when I reduce the count to 2 employers, I have empty spaces for the appointment in the display, but three appointments overlap. Shown in the attached pictures.

The Binding is normal - only colours will be set on the event appointment creation event.

The datasource is like (with additional Properties, that doesn't matter here)

Incorrect: Filtering over two Agents (17-18.02.2015)
---------------------------------------------------------------------

ID      olStarttime             olAllDayEvent     olEndtime                   Displayshort        Agent

115755    2015-02-17 12:00:00.000    0                2015-02-17 17:30:00.000    NG | XXX3 - Fix        NG
115757    2015-02-17 09:00:00.000    0                2015-02-17 11:00:00.000    MF | XXX5 - Fix        MF
115776    2015-02-17 09:15:00.000    0                2015-02-17 09:30:00.000    NG | XXX1 - Fix        NG
115778    2015-02-17 09:15:00.000    0                2015-02-17 09:30:00.000    MF | XXX1 - Fix        MF
115779    2015-02-17 09:00:00.000    0                2015-02-17 10:00:00.000    MF | XXX2                MF

Correct: Filtering over three Agents (17-18.02.2015)
---------------------------------------------------------------------

ID      olStarttime             olAllDayEvent     olEndtime                   Displayshort        Agent

115755    2015-02-17 12:00:00.000    0                2015-02-17 17:30:00.000    NG | XXX3 - Fix        NG
115757    2015-02-17 09:00:00.000    0                2015-02-17 11:00:00.000    MF | XXX5 - Fix        MF
115775    2015-02-17 09:15:00.000    0                2015-02-17 09:30:00.000    MH | XXX1 - Fix        MH
115776    2015-02-17 09:15:00.000    0                2015-02-17 09:30:00.000    NG | XXX1 - Fix        NG
115778    2015-02-17 09:15:00.000    0                2015-02-17 09:30:00.000    MF | XXX1 - Fix        MF
115779    2015-02-17 09:00:00.000    0                2015-02-17 10:00:00.000    MF | XXX2                MF

Scheduler Options are:

  <telerik:RadScheduler ID="MainScheduler" runat="server" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday"
            Skin="Office2007" Font-Names="Arial, Helvetica, sans-serif" AllowDelete="False"
            AllowEdit="true" AllowInsert="False" OverflowBehavior="Scroll" Width="100%"
            EnableViewState="false" OnClientAppointmentContextMenu="appointmentContextMenu"
            OnClientTimeSlotContextMenu="timeSlotContextMenu" OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick"
            CustomAttributeNames="Displayshort,_ROWLAYOUT,CanBeEdit,DisplayStartTime,DisplayEndTime,Owner,TerminTyp,MoveAllowed"
            OnClientAppointmentMoveStart="MainScheduler_OnClientAppointmentMoveStart" OnClientNavigationCommand="OnClientNavigationCommand"
            OnClientAppointmentMoveEnd="MainScheduler_OnClientAppointmentMoveEnd" MonthVisibleAppointmentsPerDay="10"
            OnClientAppointmentEditing="OnClientAppointmentEditing"
            OnClientAppointmentResizeStart="OnClientAppointmentEditing"
            meta:resourcekey="MainSchedulerResource1">
            <AppointmentTemplate>
                <div style="padding: 0px 1px 0px 1px">
                    <%#Eval("DisplayStartTime")%><%#Eval("Displayshort")%><%#Eval("DisplayEndTime")%></div>
            </AppointmentTemplate>
            <TimelineView UserSelectable="false" />
            <MonthView VisibleAppointmentsPerDay="10" />
            <Localization AllDay="Ganzt&#228;gig" Cancel="Abbrechen" HeaderDay="Tag" HeaderMonth="Monat"
                HeaderNextDay="n&#228;chster Tag" HeaderPrevDay="vorheriger Tag" HeaderToday="Heute"
                HeaderWeek="Woche" Show24Hours="Den ganzen Tag anzeigen" ShowBusinessHours="Arbeitszeit anzeigen"
                ShowMore="mehr..." />
        </telerik:RadScheduler>

Has anyone an idea why the scheduler overlapping these appointments on filtering of appointments of two agents but not on three agents???

Thanks a lot for any ideas.
Boyan Dimitrov
Telerik team
 answered on 19 Mar 2015
1 answer
255 views

hello,

i'm testing out 2 controls, the radgrid and the RadComboBox, i'm created a custom edit form using web form user control (ascx) onto which i add labels, textboxes and and dropdownlists, however i'm getting a weird behaviour, this is the expected behaviour:

 --- the first dropdown(1) needs to be filled with for example "None,A,B,C,D,E,F,G" while the second dropdown(2) needs to be filled with for example "None,F1,F2,F3,F4,F5,F6"

however what i'm getting is:
 --- the first dropdown(1) is filled with "None,F1,F2,F3,F4,F5,F6" and has the correct index while the second dropdown(2) is also filled with "None,F1,F2,F3,F4,F5,F6" and has the correct selected item, which means that the data binding i made to the first dropdown list is overwritten somewhere with the items from the last dropdown created.

if i run the application on debug mode, everything's ok but when the custom edit form opens, all the combos have the exact same items in them, here's my code for creating and adding controls


details.ascx

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Details.ascx.vb" Inherits="Project.Details" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<div id="template_edit" style="background-color:red" runat="server">
<%-- div onto which all my controls are addded --%> </div>   
<div id="editfooter">
         <asp:Button ID="Button_aceitar" Text="Update" runat="server" CommandName="Update" Visible="true"></asp:Button>
        <asp:Button ID="Button2" Text="Insert" runat="server" CommandName="PerformInsert" Visible="true"></asp:Button> &nbsp;
        <asp:Button ID="Button_cancelar" Text="Cancelar" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
        <asp:Label ID="LabelLOG" runat="server" Text="Label" Visible="False"></asp:Label>
</div>


details.ascx.vb (this is just the essential bit of the code because the entire code is very very long on account that the controls are created and added based on metadata tables)

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsPostBack Then
Try
                    sOper = Session("OPERACAO_Edit")
                    gPeriodo = Session("PERIODO_Edit")
                    gClasse = Session("CLASSE_Edit")
                    gSistema = Session("SISTEMA_Edit")
                Catch ex As Exception
  
                End Try
  
gEG = Session("EntidGest")
                Select Case gClasse & gSistema
                    Case 11
                        gMNID = 1
                    Case 12
                        gMNID = 2
                    Case 21
                        gMNID = 3
                    Case 22
                        gMNID = 4
                    Case 31
                        gMNID = 5
                    Case 32
                        gMNID = 6
                End Select
  
                Add_Controls(sOper)
  
Else
                gPeriodo = Request.QueryString("periodo")
                gClasse = Request.QueryString("classe")
                gSistema = Request.QueryString("sistema")
                gEG = Session("EntidGest")
                Select Case gClasse & gSistema
                    Case 11
                        gMNID = 1
                    Case 12
                        gMNID = 2
                    Case 21
                        gMNID = 3
                    Case 22
                        gMNID = 4
                    Case 31
                        gMNID = 5
                    Case 32
                        gMNID = 6
                End Select
            End If
        Catch ex As Exception
  
        End Try
  
    End Sub
  
  
Private Sub Detail_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Try
  
            gVALIDATETEXT = "a-záâàãéêèíîìóôòõúûùçA-ZÁÂÀÃÉÊÈÍÎÌÓÔÒÕÚÛÙÇ .,;:/+\?!0-9<>_=&-"
            gVALIDATETEXT = gVALIDATETEXT.Replace("a-z", "")
            gVALIDATETEXT = gVALIDATETEXT.Replace("A-Z", "")
            gVALIDATETEXT = gVALIDATETEXT.Replace("0-9", "")
  
        Catch ex As Exception
            gText = System.Reflection.MethodBase.GetCurrentMethod().Name & " Erro: " & Me.Page.ToString & " " & ex.Message
            Add2LogFile(glogpath, gText)
        End Try
    End Sub
  
  
  
  
    Private Sub Add_Controls(ByVal bOper As String)
  
  
'this bit of code is inside a loop that goes through some metadata, creates and adds controls to a div
        Dim oCmb As New RadDropDownList
        Dim oTextBox As New TextBox
        Dim gSqlCMB As New SqlDataSource
        Dim sValue as String
  
        oCmb = New RadDropDownList
        oCmb.ID = 'something dynamic
  
        gSQL = "select c,t from table" 'the query is different for each dropdownlist
        gSqlCMB.SelectCommand = gSQL
        oCmb.DataSource = gSqlCMB
        oCmb.DataValueField = "C"
        oCmb.DataTextField = "T"
        oCmb.DataBind()
        ocmb.SelectedIndex = sValue '"1", "2", "3"....
        template_edit.controls.Add(oCmb)


am i missing some dropdownlist event after binding or setting the selectedindex?

Hristo Valyavicharski
Telerik team
 answered on 19 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?