Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
157 views
This issue has me totally lost.

I have a formview with several radcontrols and a UserControl.

The user control has a RadGrid and an ObjectDataSource.

When I call the UpdateItem method on the formview with the following code:

protected void BtnSave_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
 this.MyFormView.UpdateItem(true);
}
}

I get the following exception:

InvalidOperationException: Collection was modified; enumeration operation may not execute

Here's the stack trace:

   
at System.Web.UI.ControlCollection.ControlCollectionEnumerator.MoveNext()
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)
  at System.Web.UI.WebControls.DataBoundControlHelper.ExtractValuesFromBindableControls(IOrderedDictionary dictionary, Control container)

-------------

The stack trace doesn't say much and didn't help me track the problem, but I ended up figuring out that what was causing the problem is a GridDateTimeColumn defined inside the radgrid (there's only one datetime column) that's inside my user control as such:

<telerik:GridDateTimeColumn DataField="DeadlineDate" UniqueName="DeadlineDate"
     DataFormatString="{0:dd MMM yyyy}" 
HeaderText="Deadline" />

When I remove this column, the call to the formview's UpdateItem method works well. When I put it back, I get the error again. I tried playing w/ the properties, binding to another datetime column, recreating the whole file from scratch, removing everything in the code behind file of the user control, and nothing works. The weird thing is, I have datetime columns in other usercontrols built the same way, and everything works fine there.

Here's the usercontrol definition:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GridViewTest.ascx.cs"
    Inherits="TestSolution.WebUI.UserControls.GridViewTest" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<telerik:RadGrid ID="TestRadGrid" runat="server" AllowFilteringByColumn="True" AutoGenerateColumns="false"
    AllowPaging="True" AllowSorting="True" CellSpacing="0" DataSourceID="TestDataSource"
    GridLines="None" Skin="Office2007">
    <MasterTableView EditMode="InPlace" DataKeyNames="PeriodID">
        <Columns>
            <telerik:GridBoundColumn DataField="PeriodID" UniqueName="PeriodID"
                Visible="false" />
            <telerik:GridBoundColumn DataField="SpecificityID" UniqueName="SpecificityID" />
            <telerik:GridDateTimeColumn DataField="DeadlineDate" UniqueName="DeadlineDate" DataFormatString="{0:dd MMM yyyy}"
                HeaderText="Deadline " />
            <telerik:GridBoundColumn DataField="DeadlineDate" UniqueName="DeadlineDate" HeaderText="Deadline" />
            <telerik:GridNumericColumn DataField="OutstandingAmountBeforeDeadline" UniqueName="OutstandingAmountBeforeDeadline"
                NumericType="Number" HeaderText="O/S Before Repayment" />
            <telerik:GridNumericColumn DataField="InterestAmount" UniqueName="InterestAmount"
                NumericType="Number" HeaderText="Interest" />
            <telerik:GridCheckBoxColumn DataField="ToDelete" UniqueName="ToDelete" HeaderText="Delete" />
            <telerik:GridEditCommandColumn ButtonType="PushButton" InsertText="Insert" EditText="Edit"
                CancelText="Cancel" UniqueName="EditCommandColumn" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
<asp:ObjectDataSource ID="TestDataSource" runat="server" TypeName="TestSolution.WebUI.ObjectDataSource.TestDataSource"
    SelectMethod="GetTestTableByCriterias">
    <SelectParameters>
        <asp:Parameter Name="TestType" Type="Int32" />
        <asp:Parameter Name="SpecificityID" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>

Any ideas? :(
Shinu
Top achievements
Rank 2
 answered on 26 Feb 2014
3 answers
237 views
Looking for some positioning/z-index guidance on the RadWindow. I've played around for probably too much time and haven't budged a thing so I'm hoping an expert can speed me along.

We have a page with multiple user controls and a ton of Rad items (grids, comboboxes, windows, oh my!). In multiple places we are using RadWindows to pop up attachment selection, searches, etc. These RadWindows are not playing well with an Iframe that is a document preview. The RadWindow is appearing partially behind (or fully behind in some cases) an Iframe doc preview when the file type is unsupported (which is just a white box, since the file in question was opened/saved to the native desktop). This is only happening in IE.

The fact that it is only happening in IE and that IE handles z-indexes differently really leads me to believe I'm not handling the z-index correctly. I've attached two example images. Both of these have a large white box in the document preview area because I have chosen a file of type .docx. The first image shows a fully blocked RadWindow. The second a partially blocked RadWindow.

Z-index of fully blocked: 3001
Z-index of partially blocked: 3005

Any advice (even of a non z-index variety) would be greatly appreciated. Thanks!
Marin Bratanov
Telerik team
 answered on 26 Feb 2014
6 answers
246 views
Hii

i have added column reorder and export to excel and pdf.
when i dont reorder any columns , the export works fine
but when i re order the column and try to export its failing
anybody know why?

 <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" >
                      
                            <Resizing AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="false"
                              EnableRealTimeResize="false" AllowResizeToFit="true" />
                  </ClientSettings>
<ExportSettings  FileName = "Scheduled Report Metrics" IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData = "true">
                         <pdf PageWidth="297mm" PageHeight="210mm" PageTitle = "Scheduled Report Metrics " />
                 </ExportSettings>

Server Error in '/Web' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.Grid.Export.TableViewExporter.PdfExportRenderForm(HtmlTextWriter nullWriter, Control form) +347
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +8689033
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   Telerik.Web.UI.Grid.Export.TableViewExporter.PdfExportRenderPage(HtmlTextWriter nullWriter, Control page) +145
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266
Kostadin
Telerik team
 answered on 26 Feb 2014
3 answers
251 views
Hi,

I want to export radgrid data in excel file with xlsx extension.
I checked out this link  but of no use
http://www.telerik.com/community/forums/aspnet-ajax/grid/grid-export-to-excel--xlsx-format.aspx


myGrid.ExportSettings.Excel.Format = GridExcelExportFormat.Biff ; 
myGrid.MasterTableView.ExportToExcel();

I am using trial version of Q2 2012.

Can anyone help me here?

Thanks....
Princy
Top achievements
Rank 2
 answered on 26 Feb 2014
1 answer
94 views
Hello All,
     I have a grid, that in the ItemCommand event handler subroutine I handle the "RowClick" with a call to another sub...  Now here's where it gets interesting...  In the first cell/column of a row, I have an Image.  I would like it so that when the user "Clicks" the image that it fires off a server side event that I can capture and call my same sub that handles the "RowClick" event... I know that if the user clicks the "white" space around the image, that the ItemCommand event is fired for the "RowClick", but NOT for clicking inside the image itself...  The image is large enough and takes up a good bit of the cell that there is very little "white" space around it, and that it would seem to be very frustrating that nothing happens when the image itself is clicked...  
    Right now, how things stand is that it's a plain column, and a plain image in the cell.  I have NOT looked at placing an ImageButton in the cell, as I have not used that control before, nor have I looked at a GridImageColumn or a GridBinaryImageColumn yet.  the two alternative column types don't quite seem to be want I looking for, as the images are not stored in a database  or in a particular URL...  
    So...  Is there anyway to have the Image fire off some sort of server event when it is clicked or not???  That is the question of the day...

Thanks in advance!,

Kevin Orcutt
Matson Money Inc.
(513) 204-8000 x8245
(513) 204-8245 (Direct)
Kevin.Orcutt@MatsonMoney.com
www.MatsonMoney.com
Eyup
Telerik team
 answered on 26 Feb 2014
1 answer
59 views
Hi ,

I Have a a ragrid and i enter the data into the grid from textboxes .I have two fields one is the name and Description fields with an unique id in the database. I want to edit the rows on double click of that particular row in the radgrid and on the double click have an update button shown in another column and update button  has the code in the code behind?


Thanks in advance

Eyup
Telerik team
 answered on 26 Feb 2014
8 answers
342 views
Hi All,

I have an all code-behind solution where I build out the grid columns based upon the DataView acquired from the SqlDataSource.  I'd like to be able to dynamically switch the SqlDataSource for the grid with different drop-down-list options.  I'm doing something like this, but it appears that I'm getting vague errors.  I am re-using the SqlDatasource variable and re-building whenever the User switches the drop-down-list option.  I also re-build my RadGrid's columns using the new DataView from the updated SqlDataSource.  I then rebind(); just like in that link, but I do not autogenerate columns.

Can you anyone please help me?

Thanks,
Mark
Marin
Telerik team
 answered on 26 Feb 2014
3 answers
94 views
Hi

I'm trying to create a Department Planner.

I need time in 15 mins interval for 24 hours horizontally on the header and employees name vertically. I need to be able to select the time interval for each employees. Also, I need to group employees based on their job profile. I also need a few footers to calculate totals.

For example

                                        6:00                   7:00                   8:00                9:00            10:00 .............................n                                                            Total hrs worked
                                  15   30   45       15   30   45       15  30   45     15   30  45    15   30  45

Group A - Emp1      highlight back color if working and if double clicked on a particular 15 mins interval then change the colour                                Group A - Emp2                                     
Group A - Emp3
     :
Group A -Footer total...

Group B - Emp1
Group B - Emp2
    :
Group B - Footer total


What' s the best control that I can use to achieve the above scenario.

Any suggestions would be appreciated.

Thanks
Konstantin Dikov
Telerik team
 answered on 26 Feb 2014
2 answers
212 views
I have a radgrid that the user can group by collumns. He can also collapse one, or multiple groups. When exporting to pdf is it possible not to display the rows that were part of the collapsed groups? If it is possible can I get an example ,demo, or hint to make this work,please?
Thank you for you help.
Viktor Tachev
Telerik team
 answered on 26 Feb 2014
1 answer
208 views
I'm having a problem when clicking on the indent button in RichTextEditor in sitecore. Clicking the button produces a <blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"> ... </blockquote> tag, because it's the TelerikRad control that spits out this code. The <blockquote> tag causes an actual quote (") to show on the page. I just want the text to indent, not show a quote.

How can I override this behavior in TelerikRad control to produce maybe a <span> tag with indentation styling, or a <p> tag with indentation styling, rather than a <blockquote> tag?

Is there maybe some sitecore configuration setting I can modify to change the indent button's behavior to spit out a <span> or <p> tag instead of a <blockquote>?

Thanks!
Ianko
Telerik team
 answered on 26 Feb 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?