Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
Hi, I am trying to export Excel from RadGrid control, but its giving page error. Unable to debug also. Immediately its expires the page. I have used <GroupByExpressions> option in grid. Is this not allowing us to export excel ?
Because I didn't find any demos or example in from your end on export excel with <GroupByExpressions> option.

In the code behind C# code - 
buttonexport click event i have written below code

Grid.ExportSettings.IgnorePaging = true;
Grid.ExportSettings.ExportOnlyData = true;
Grid.ExportSettings.OpenInNewWindow = true;
Grid.ExportSettings.FileName = "filename";
  
Grid.MasterTableView.ExportToExcel();


if you mentioned below line before exporting method. Getting page error - 

Grid.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;

below is the apx code - 
<telerik:RadGrid
               ShowGroupPanel          ="false"
               AutoGenerateColumns     ="false"
               ID                      ="Grid"
               AllowFilteringByColumn  ="False"
               AllowSorting            ="False"
               ShowFooter              ="True"
               runat                   ="server"
               GridLines               ="Both"
               AllowPaging             ="false"
               EnableLinqExpressions   ="false"
               CssClass                ="RadGridCustomClass"
               OnPreRender             ="Grid_PreRender"
               OnExcelMLExportRowCreated="Grid_ExcelMLExportRowCreated"
               OnGridExporting         ="Grid_GridExporting"
               OnExcelMLExportStylesCreated="Grid_ExcelMLExportStylesCreated"
               OnItemDataBound         ="Grid_ItemDataBound">
               <PagerStyle Mode="NextPrevAndNumeric" />
               <MasterTableView
                   ShowGroupFooter         ="true"
                   HeaderStyle-Font-Bold   ="true"
                   HeaderStyle-ForeColor   ="#333333"
                   AllowMultiColumnSorting ="false">
                   <Columns>
                       <telerik:GridBoundColumn
                           DataField                   ="SubCategory"
                           ItemStyle-HorizontalAlign   ="Center"
                           UniqueName                  ="REP013_FuellingCategoryHeaderText"
                           FooterStyle-HorizontalAlign ="Center"
                           FooterStyle-Font-Bold       ="true"
                           HeaderStyle-HorizontalAlign ="Center" >
                       </telerik:GridBoundColumn>
                         
                       <telerik:GridBoundColumn
                           Aggregate                   ="Sum"
                           DataField                   ="Total_Fuel_Litres"
                           DataType                    ="System.Int32"
                           UniqueName                  ="REP013_TotalFuelHeaderText"
                           DataFormatString            ="{0:###,###.##}"
                           ItemStyle-HorizontalAlign   ="Center"
                           FooterStyle-HorizontalAlign ="Center"
                           FooterStyle-Font-Bold       ="true"
                           HeaderStyle-HorizontalAlign ="Center"
                           FooterText                  ="<%$ Resources:MyGlobals, REP013_TotalFuelFooterText%>">
                       </telerik:GridBoundColumn>
                         
                       <telerik:GridBoundColumn
                           Aggregate                   ="Avg"
                           DataField                   ="Bio_Content"
                           DataFormatString            ="{0:0.0%}"
                           UniqueName                  ="REP013_BioContentHeaderText"
                           ItemStyle-HorizontalAlign   ="Center"
                           FooterStyle-HorizontalAlign ="Center"
                           FooterStyle-Font-Bold       ="true"
                           HeaderStyle-HorizontalAlign ="Center" >
                       </telerik:GridBoundColumn>
                         
                       <telerik:GridBoundColumn
                           Aggregate                   ="Sum"
                           DataField                   ="Bio_Diesel_Litres"
                           DataFormatString            ="{0:###,###}"
                           UniqueName                  ="REP013_BioDieselHeaderText"
                           ItemStyle-HorizontalAlign   ="Center"
                           FooterStyle-HorizontalAlign ="Center"
                           FooterStyle-Font-Bold       ="true"
                           HeaderStyle-HorizontalAlign ="Center"
                           FooterText                  ="<%$ Resources:MyGlobals, REP013_BioDieselFooterText%>">
                       </telerik:GridBoundColumn>
                         
                       <telerik:GridBoundColumn
                           Aggregate                   ="Sum"
                           DataField                   ="Standard_Diesel_Litres"
                           DataFormatString            ="{0:###,###}"
                           UniqueName                  ="REP013_StandardDieselHeaderText"
                           ItemStyle-HorizontalAlign   ="Center"
                           FooterStyle-HorizontalAlign ="Center"
                           FooterStyle-Font-Bold       ="true"
                           HeaderStyle-HorizontalAlign ="Center"
                           FooterText                  ="<%$ Resources:MyGlobals, REP013_StandardDieselFooterText%>">
                       </telerik:GridBoundColumn>
                         
                       <telerik:GridBoundColumn
                           Aggregate                   ="Sum"
                           DataField                   ="CO2_Tonnes"
                           DataFormatString            ="{0:###,##0.0}"
                           UniqueName                  ="REP013_CO2QuantityHeaderText"
                           ItemStyle-HorizontalAlign   ="Center"
                           FooterStyle-HorizontalAlign ="Center"
                           FooterStyle-Font-Bold       ="true"
                           HeaderStyle-HorizontalAlign ="Center"
                           FooterText                  ="<%$ Resources:MyGlobals, REP013_CO2QuantityFooterText%>">
                       </telerik:GridBoundColumn>
                   </Columns>
                   <GroupByExpressions>
                       <telerik:GridGroupByExpression>
                           <SelectFields>
                               <telerik:GridGroupByField FieldName="Category" />
                           </SelectFields>
                           <GroupByFields>
                               <telerik:GridGroupByField FieldName="Category" SortOrder="Ascending" />
                           </GroupByFields>
                       </telerik:GridGroupByExpression>
                   </GroupByExpressions>
               </MasterTableView>
               <ClientSettings AllowDragToGroup    ="false" />
               <GroupingSettings ShowUnGroupButton ="false" />
           </telerik:RadGrid>


Can you please help out, how to export excel when we have <GroupByExpressions> option on aspx page.
Let me know if you need any more information.


for the reference I have added snapshots





Daniel
Telerik team
 answered on 03 Mar 2015
1 answer
164 views
I have only tested this issue on Chrome so far. Whenever I apply the filters to the Grid I am getting exception below. Sorting, Paging seem to work ok. Can someone please help with this issue?

.NET Framework=3.5
Visual Studio=2008
Ajax Controls =Telerik_UI_for_ASP.NET_AJAX_2015_1_225

Exception:
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Specified argument was out of the range of valid values.
Parameter name: index

vb.net file code:

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        PopulateGridView()
        If Not rgrdEMS.MasterTableView.FilterExpression Is String.Empty Then
            rgrdEMS.MasterTableView.Rebind()
        End If
    End Sub

    Public Function PopulateGridView() As String
        Dim oEms = GetPS2.GetEMs 'returns datatable
        rgrdEMS.DataSource = oEms
        rgrdEMS.DataBind()
        Return "Populated"
    End Function

ASPX code:


    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="true"  >
    </telerik:RadScriptManager>
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server">
    </telerik:RadSkinManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="30" Skin="Silk" >
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgrdEMS">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgrdEMS" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="EMEditWindow"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
            <telerik:RadPersistenceManager ID="RadPersistenceManager1" runat="server">
                <PersistenceSettings>
                    <telerik:PersistenceSetting ControlID="rgrdEMS" />
                </PersistenceSettings>
            </telerik:RadPersistenceManager>
            <table style="width: 100%; margin:0px; padding:0px; border-spacing:0px;">
                <tr>
                    <td style="height: 600px; border: solid 1px blue; vertical-align: top; margin:0px; padding:0px;">                                                                               
                        <div style="width:100%;">
                            <table style="width: 100%; margin-bottom:2px; ">
                                <tr style="margin:2px; border-width:0px; color: #FFFFFF; background-color: #025BB5;">
                                    <td style="margin:2px; text-align:center; ">                                    
                                        <asp:Label ID="lblTitle" runat="server" Text="Manage Engagement Managers" style="font-size:x-large; font-weight:bold;  margin-bottom:2px; "></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <table style="margin-left: 2px; margin-right: 3px; margin-top: 2px;margin-left: -x/2px;">
                                <tr>
                                    <td>

<telerik:RadGrid ID="rgrdEMS" runat="server" AllowPaging="True" PageSize="15" AllowSorting="True"
                                        AllowFilteringByColumn="True" CommandItemDisplay="Top" EnableLinqExpressions="false"
                                        OnItemCommand="rgrdEMS_ItemCommand" CellSpacing="0" GridLines="None" Skin="Silk">
                                        <MasterTableView AutoGenerateColumns="false" CommandItemDisplay="Top" TableLayout="Fixed" >
                                            <CommandItemTemplate>
                                                <div style="padding: 5px 5px;">
                                                    <asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="openConfirmationWindow('',0,0,'','',''); return false;" Visible="true"><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.png"/>Add new EM</asp:LinkButton>&nbsp;&nbsp;
                                                    <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.png"/>Refresh EM list</asp:LinkButton>
                                                </div>
                                            </CommandItemTemplate>
                                            <ColumnGroups>
                                                <telerik:GridColumnGroup Name="GeneralInformation" HeaderText="General Information"
                                                    HeaderStyle-HorizontalAlign="Center" />
                                                <telerik:GridColumnGroup Name="Location" HeaderText="Location"
                                                    HeaderStyle-HorizontalAlign="Center" />
                                            </ColumnGroups>
                                            <HeaderStyle Width="102px" />
                                            <Columns>
                                                <telerik:GridTemplateColumn ColumnGroupName="GeneralInformation">
                                                      <HeaderStyle Width="55px" />
                                                      <ItemTemplate>      
                                                          <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="Images/edit.gif" OnClientClick='<%# String.Format("openConfirmationWindow(""{0}"",""{1}"",""{2}"",""{3}"",""{4}"",""{5}""); return false;", Eval("ResourceName"), Eval("ID"), Eval("CM_ID"), Eval("CONTACT_DETAILS"), Eval("EM_SKILLS"), Eval("EM_AREAS")) %>'/>    
                                                          <asp:ImageButton ID="btnDelete" runat="server" OnClientClick='<%# String.Format("return confirm(""Are you sure you want to delete {0}?"");", Eval("ResourceName")) %>' CommandName="DeleteEM" CommandArgument='<%# String.Format("{0}", Eval("ID")) %>' ImageUrl="Images/deleteicon.png" />   
                                                      </ItemTemplate>          
                                                    <FilterTemplate>
                                                    </FilterTemplate>            
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn DataField="ResourceName" HeaderText="Resource Name" UniqueName="ResourceName"
                                                    ColumnGroupName="GeneralInformation">
                                                    <HeaderStyle Width="120px" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Contact_Details" HeaderText="Additional Contact Details" UniqueName="Contact_Details" ColumnGroupName="GeneralInformation">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="GeoKey" HeaderText="Geography" UniqueName="GeoKey" ColumnGroupName="Location">
                                                    <HeaderStyle Width="100px" />
                                                        <FilterTemplate>
                                                            <telerik:RadComboBox ID="GeographyCombo" runat="server" Height="200px" Width="95px" SelectedValue='<%# CType(Container, GridItem).OwnerTableView.GetColumn("GeoKey").CurrentFilterValue %>'
                                                                OnClientSelectedIndexChanged="GeographyComboIndexChanged" >
                                                                <Items>
                                                                    <telerik:RadComboBoxItem Text="All" Value="" />
                                                                    <telerik:RadComboBoxItem Text="AMER" Value="AMER" />
                                                                    <telerik:RadComboBoxItem Text="APAC" Value="APAC" />
                                                                    <telerik:RadComboBoxItem Text="AMEA" Value="AMEA" />
                                                                    <telerik:RadComboBoxItem Text="USPS" Value="USPS" />
                                                                    <telerik:RadComboBoxItem Text="Unassigned" Value="UNASSIGNED" />
                                                                </Items>
                                                            </telerik:RadComboBox>
                                                            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                                                <script type="text/javascript">
                                                                    function GeographyComboIndexChanged(sender, args) {
                                                                        var tableView = $find("<%# CType(Container, GridItem).OwnerTableView.ClientID %>");
                                                                        tableView.filter("GeoKey", args.get_item().get_value(), "EqualTo");
                                                                    }
                                                                </script>
                                                            </telerik:RadScriptBlock>
                                                            
                                                        </FilterTemplate>
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Area_Title" HeaderText="Area" UniqueName="Area_Title"
                                                    ColumnGroupName="Location">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Office_Name" HeaderText="Office" UniqueName="Office_Name"
                                                    ColumnGroupName="Location" FilterControlWidth="60px">
                                                    <HeaderStyle Width="115px" />                                                            
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                            <PagerStyle PageSizes="5,10,15" PagerTextFormat="{4}<strong>{5}</strong> EMs matching your search criteria"
                                                PageSizeLabelText="EMs per page:" />
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                    </td>
                                </tr>
                            </table>
                        </div>                        
                    </td>
                </tr>
            </table>

Pavlina
Telerik team
 answered on 03 Mar 2015
1 answer
75 views
Hello Telerik Team,

I would like to inquire regarding the issue I'm currently encountering in RadUpload. I already deployed my website in IIS and I (single user) was able to see the progress bar whenever I click the button, but when multiple users access the site they where not able to see the progress bar. Are there any solutions for this? Thanks! 
Peter Filipov
Telerik team
 answered on 03 Mar 2015
1 answer
90 views
I am using RadSpell in my application and it was working fine before 2 days but today I have updated my telerik (2015).
After update telerik Add Custom option is not working in rad spell. I have also check on your site that is not working. 
http://demos.telerik.com/aspnet-ajax/spell/examples/overview/defaultcs.aspx
please help me as soon as possible.
Misho
Telerik team
 answered on 03 Mar 2015
1 answer
145 views
I have a RadListView with a RadDataPager (see below). Every time a user hits "FirstPrev"
 button the OnPageIndexChanged  event fires three times.

Why is this happening and how do I prevent it?

<telerik:RadListView ID="RadListView1" runat="server" AllowPaging="True" ItemPlaceholderID="PlaceHolder1"
    Skin="listview_2" EnableEmbeddedSkins="false" OnItemDataBound="RadListView1_ItemDataBound" AllowCustomPaging="true"
    DataKeyNames="id,filenameextension,typeAbbr,title,fidTimeOfDay" OnNeedDataSource="RadListView1_NeedDataSource" OnPageIndexChanged="RadListView1_PageIndexChanged" OnPageSizeChanged="RadListView1_PageSizeChanged" >
    <LayoutTemplate>
        <div class="RadListView RadListViewFloated RadListView_Windows7">
            <telerik:RadDataPager ID="RadDataPager1" runat="server" PageSize="25" PagedControlID="RadListView1"
                BorderWidth="0" OnFieldCreated="RadDataPager1_FieldCreated" CssClass="dataPagerClass">
                <Fields>
                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                    <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="5" />
                    <telerik:RadDataPagerButtonField FieldType="NextLast" />
                    <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />
                    <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go"
                        TextBoxWidth="15" />
                    <telerik:RadDataPagerTemplatePageField>
                        <PagerTemplate>
                            <b>Total Number of Assets Found:
                                <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" />
                            </b>
                        </PagerTemplate>
                    </telerik:RadDataPagerTemplatePageField>
                </Fields>
            </telerik:RadDataPager>
            <asp:PlaceHolder ID="PlaceHolder1" runat="server" />
        </div>
    </LayoutTemplate>
    <ItemTemplate>
        <div style="float: left; width: 162px; height: 200px; background-color: White;">
            <asp:Panel ID="myThumb" runat="server" CssClass="myClass" Style="border: 0; white-space: normal; padding: 5px 4px 25px 2px; text-align: center; width: 160px; background-color: white; margin-left: 2px;">
                <div style="width: 150px; height: 150px; margin-left: 2px;">
                    <asp:HyperLink ID="HyperLink1" runat="server">
                        <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AutoAdjustImageControlSize="false"
                            CssClass="myClass" ImageUrl='<%# Eval("thumbUrl") %>' AlternateText="Click to view preview"
                            ToolTip="Click to view preview" />
                    </asp:HyperLink><br />
                </div>
                <asp:CheckBox ID="ChkImage" runat="server" Style="float: left; padding-top: 5px" /><small><asp:HyperLink
                    ID="lnkAsset1" runat="server" Visible="false" Style="float: left; padding-top: 5px; text-decoration: none; font-weight: normal; font-size: 7pt;">
                </asp:HyperLink><asp:HyperLink ID="lnkAsset2" runat="server" Style="float: left; text-decoration: none; font-weight: normal; font-size: 7pt;">
                </asp:HyperLink><asp:HyperLink ID="lnkAsset3" runat="server" Style="float: left; padding-left: 20px; text-decoration: none; font-weight: normal; font-size: 7pt;"></asp:HyperLink></small><br />
                <asp:HiddenField ID="hiddenAssetId" Value='<%# Eval("id") %>' runat="server" />
            </asp:Panel>
        </div>
    </ItemTemplate>
    <EmptyDataTemplate>
        No Assets Found
    </EmptyDataTemplate>
</telerik:RadListView>

Konstantin Dikov
Telerik team
 answered on 03 Mar 2015
1 answer
80 views
I'm having a problem with the telerik:radscheduler control. I have a calendar with three appointments on it (Tuesday 12:30-1:30, Wednesday 7-4, Thursday 12:30-1:30 named ctl00_MainContent_Scheduler_1_0,ctl00_MainContent_Scheduler_0_0, ctl00_MainContent_Scheduler_2_0 respectively).

If you open or move any of the events, the only appointment that is effected is the Wednesday (ctl00_MainContent_Scheduler_0_0) appointment that is affected. If you move the Thursday event up a week, the Wednesday event is the one that's moved. Same with Tuesday, effect Wednesday. If you open any of the events for details, the Wednesday events details are populated.

I've walked the code and confirmed that the datasource is populating everything correctly.

Here's my code:

The control itself
    <telerik:RadScheduler runat="server" ID="Scheduler" SelectedView="MonthView" DayStartTime="07:00:00" DayEndTime="21:00:00"
        FirstDayOfWeek="Monday" LastDayOfWeek="Friday" AllowInsert="False" AllowDelete="False" DataKeyField="MyID" DataSubjectField="MyName"
        DataStartField="MyDate" DataEndField="MyDateEnd" OnNavigationCommand="Scheduler_OnNavigationCommand" RowHeight="50px"
        Height="100%" CustomAttributeNames="MyOtherName, MyString, MyInfo, MyLocation,TimeZoneMessage,Type,MyPlace,MyReason,MyDate, MyDateEnd" OnAppointmentDataBound="Scheduler_OnAppointmentDataBound">
        <AppointmentTemplate>
            <div>
                <%# Eval("Subject") %>
            </div>
            <div>
            <%# Eval("MyName") %>  <%# Eval("MyString") %> 
                </div>
            <%# Eval("MyInfo") %>
        </AppointmentTemplate>
        <AdvancedForm Modal="True" />
        <AdvancedEditTemplate>
            <scheduler:AdvancedForm runat="server" ID="AdvancedForm" Mode="Edit" Subject='<%# Bind("Subject") %>'
                Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' MyName='<%# Bind("MyName") %>'
                MyString='<%# Bind("MyString") %>' MyInfo='<%# Bind("MyInfo") %>' Location='<%# Bind("Location") %>'
                TimeZoneMessage='<%# Bind("TimeZoneMessage") %>' Type='<%# Bind("Type") %>' MyPlace='<%# Bind("MyPlace") %>' MyReason='<%# Bind("MyReason") %>'/>
        </AdvancedEditTemplate>
    </telerik:RadScheduler>


In the AdvancedFormTemplate.ascx.cs:

        protected Appointment Appointment
        {
            get
            {
                SchedulerFormContainer container = (SchedulerFormContainer)BindingContainer;
                return container.Appointment;
            }
        }

container.Appointment always contains the Wednesday control, even if you click on the other two.

Code behind to populate:


            Scheduler.DataSource = items;
            Scheduler.DataBind();

I've verified items contains exactly what I expect (3 separate and correct events).

When the calendar month displays, the 3 appointments each display the correct information. It's almost like they load correctly but the appointment events are tied to the Wednesday appointment handlers.

Anyone have a clue for this?
Bozhidar
Telerik team
 answered on 03 Mar 2015
1 answer
105 views
Hi,

I am using telerik rad grid (v. 2014).
When I try to resize columns I get an unexpected result (attached screen shot) - there is a white space at the right side.

Is there any way that the grid will automatically use all the width?

Thanks 
Pavlina
Telerik team
 answered on 03 Mar 2015
4 answers
361 views
Hi All,

          we are using RadScheduler as a Calendar control. and we have a requirement of creating an Event spanning multiple days.
          ex: StartDate 02-Feb-2015 and EndDate 06-Feb-2015.
 
          and we want the Event Name to be shown spanning these 5 days( rather It should be covering all these 5 days).
          But in the current situation it is showning event on 2nd Feb and 6 Feb.
 
          is there any CSS class or property to be added to achieve this.

          Thanks!!

Regards,
Charan
Thomas
Top achievements
Rank 1
 answered on 03 Mar 2015
2 answers
93 views
Hi.
I try to use RadClientExportManager witch OpenStreetMaps control. When I plot *.gpx file on the map ClientExportManager have a problem with export to pdf or png those lines.
I dont have controls on the map after exoprt too.
See attachat pictures.
Capture1 - oryginal
Capture 2 - exported

Krzysztof

Peter Filipov
Telerik team
 answered on 03 Mar 2015
2 answers
163 views
I am seeing an intermittent problem where users are getting the exception above when RadListView perfoms a DataBind. I am not sure how it can happen, because my code creates a data table and assigns it to the RadListView. Even if it failed to add anything to the data table, it wouldn't cause an exception. Could this be caused by one of the controls in the template?

Here's the stack trace:
ERROR=Cannot perform this operation when DataSource is not assigned. 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() 
<my code..>

Here's the HTML:

<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>

The CodeBehind looks like this:
        radListView.DataSource = GetDataTable(strCollectionID, strCollectionName, strDesignerID, strDesignerName, strProductTypeID, strProductTypeName, strRoomID, strRoomName, strSearch);
        radListView.DataBind();
 
...
 
    public DataTable GetDataTable(string strCollectionID, string strCollectionName, string strDesignerID, string strDesignerName, string strProductTypeID, string strProductTypeName, string strRoomID, string strRoomName, string strSearch)
    {
        DataTable dt = new DataTable();
 
(Put some stuff in the table)
 
        return dt;
    }
Konstantin Dikov
Telerik team
 answered on 03 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?