Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
163 views
Hi there.

I have a scheduler that I would like to expand to 100% of the available screen, but NOT expand beyond that.  Setting the height of the Scheduler to 100% and then the overflow behaviour to EITHER scroll or expand does not seem to do the trick - in both instances, the scheduler expands to extend the height of the window.  This is a problem because Chrome and IE do not seem to like it when you drag appointments higher or lower up the screen (ie require an "automatic" scroll) if it is the window's scrollbar that must be used instead of the schedulers.

I can set the height of the scheduler to say 1000 pixels to get the functionality that I'm after, but of course I won't necessarily know the height of the window.  And I can set the height with javascript onload etc, but that gets messy when dealing with ajax postbacks and dealing with window resizes etc.  Am I missing something simple?

Thanks,

Matthew

Veronica
Telerik team
 answered on 10 Dec 2010
5 answers
104 views
Hi.  After upgrading to Q3 2010, export to pdf is now throwing a run time error (see below).  The export functionality was working fine with Q2 2010.  Also noticed the export to PDF no longer works on the demo page:

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx

System.NullReferenceException: Object reference not set to an instance of an object.
  at Telerik.Web.Apoc.Pdf.PdfFontCreator.CreateBase14Font(String pdfFontID, Base14Font base14)
  at Telerik.Web.Apoc.Pdf.PdfFontCreator.MakeFont(String pdfFontID, Font font)
  at Telerik.Web.Apoc.Pdf.FontSetup.AddToResources(PdfFontCreator fontCreator, PdfResources resources)
  at Telerik.Web.Apoc.Render.Pdf.PdfRenderer.StopRenderer()
  at Telerik.Web.Apoc.StreamRenderer.StopRenderer()
  at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)

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.SystemException: System.NullReferenceException: Object reference not set to an instance of an object.
  at Telerik.Web.Apoc.Pdf.PdfFontCreator.CreateBase14Font(String pdfFontID, Base14Font base14)
  at Telerik.Web.Apoc.Pdf.PdfFontCreator.MakeFont(String pdfFontID, Font font)
  at Telerik.Web.Apoc.Pdf.FontSetup.AddToResources(PdfFontCreator fontCreator, PdfResources resources)
  at Telerik.Web.Apoc.Render.Pdf.PdfRenderer.StopRenderer()
  at Telerik.Web.Apoc.StreamRenderer.StopRenderer()
  at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)
Daniel
Telerik team
 answered on 10 Dec 2010
1 answer
76 views
Hello,

I have a RadGrid I am using for customer maintenance. I would like the users to be able to insert, update and delete customers from this RadGrid. I'd also like to notify them that "Insert for customer: XXXXXX succeeded", "Customer XXXXXX updated" or "Unable to delete customer XXXXXX" after the insert/update/delete either succeeds or fails. Since I am setting the RadGrid's DataSource property in the RadGrid1_NeedDataSource event, I don't think that I can use AllowAutomaticDeletes, AllowAutomaticInserts, or AllowAutomaticUpdates along with the ItemDeleted, ItemInserted, or ItemUpdated events (if I can, I must have been doing something wrong).

Is there a way to notify the user the status of the operation without setting the RadGrid's DataSourceID and enabling Automatic operations?

Thanks,
Casey

***EDIT - I was able to accomplish this by setting a session variable in the ItemCommand of the RadGrid and then adding a new literal control to the end of the RadGrid with the session variable text as the message. 
Tsvetoslav
Telerik team
 answered on 10 Dec 2010
1 answer
143 views
Hi all,
I've some problem (I weakness in english language but I'll try to explain.)  
Firstly, I've created dynamically column from telerik gridview but I couldn't save new data to datatable

About telerik gridview that I try to this code 

 void grid_UpdateCommand(object source, GridCommandEventArgs e)
    {
        Hashtable newValues = new Hashtable();
        GridEditableItem item = e.Item as GridEditableItem;
        item.OwnerTableView.ExtractValuesFromItem(newValues, item);
        Response.Write("Updated Name: " + newValues["ContactName"].ToString());

    }
 void grid_UpdateCommand(object source, GridCommandEventArgs e)
    {
        Hashtable newValues = new Hashtable();
        GridEditableItem item = e.Item as GridEditableItem;
        item.OwnerTableView.ExtractValuesFromItem(newValues, item);
        Response.Write("Updated Name: " + newValues["ContactName"].ToString());

    }
 void grid_UpdateCommand(object source, GridCommandEventArgs e)
    {
        Hashtable newValues = new Hashtable();
        GridEditableItem item = e.Item as GridEditableItem;
        item.OwnerTableView.ExtractValuesFromItem(newValues, item);
        Response.Write("Updated Name: " + newValues["ContactName"].ToString());

    }
void grid_UpdateCommand(object source, GridCommandEventArgs e)
   {
       Hashtable newValues = new Hashtable();
       GridEditableItem item = e.Item as GridEditableItem;
       item.OwnerTableView.ExtractValuesFromItem(newValues, item);
       Response.Write("Updated Name: " + newValues["ContactName"].ToString());
 
   }

this code is perform to gather new value (when you key in new value in editable textbox),In runtime mode will through to   grid_UpdateCommand method. that's ok  (I can show new value )

But my purpose want to loop all new value (when you key in new value) into my Data-table 
as following 
Hashtable newValues = new Hashtable();
            foreach (GridEditableItem Item in grid.MasterTableView.Items)
            {
               
                Item.OwnerTableView.ExtractValuesFromItem(newValues, (GridEditableItem)Item);
                string str = newValues[0].ToString();
            }

But I couldn't  get new value when I loop from grid (I couldn't use ExtractValuesFromItem method it displayed error message as "Unable to cast object of type 'MyItemTemplate' to type 'System.Web.UI.IBindableTemplate'."

How should I do this problem ? 

Thanking in advance
 Bhadhai
Martin
Telerik team
 answered on 10 Dec 2010
1 answer
106 views
I'm ready to post a small, but helpful project in the Code Library.  However, there isn't a Button section in the Code Library yet.  Any "expected" date on adding the Button section to the Code Library?

Thanks!
Georgi Tunev
Telerik team
 answered on 10 Dec 2010
5 answers
326 views
I am having some trouble setting the header text of my columns.
I am getting an error on .MasterTableView.Columns(i).HeaderText = ... (the other side of the equation works fine).
Here is the error:
Failed accessing GridColumn by index. Please verify that you have specified the structure of RadGrid correctly.

 
Protected Overridable Sub FormatGrid()
    Try
        With mGridEx
            .DataSource = mDs
             If Not IsPostBack() Then
                .Font.Name = "Verdana"
                .Font.Size = New WebControls.FontUnit("8.5pt")
            End If
            .DataBind()
            For i As Integer = 0 To mDs.Tables(mTableName).Columns().Count - 1
                .MasterTableView.Columns(i).HeaderText = mDs.Tables(mTableName).Columns(i).Caption
            Next
        End With
    Catch ex As System.NullReferenceException
    Catch ex As Exception
        Dim error1 As String = ex.ToString()
    End Try
End Sub
Princy
Top achievements
Rank 2
 answered on 10 Dec 2010
3 answers
85 views
I have this code to dynmically create a checkbox template field and then access the settings of the checkbox:
        SearchResultGrid.Columns.Clear()
        Dim templateColumnName As String = "Delete"
        Dim col2 As Telerik.Web.UI.GridTemplateColumn = New Telerik.Web.UI.GridTemplateColumn
        col2.EditItemTemplate = New MyTemplate(templateColumnName)
        col2.ItemTemplate = New MyTemplate(templateColumnName)
        col2.HeaderText = templateColumnName
        SearchResultGrid.Columns.Add(col2)

    Private Class MyTemplate
        Implements ITemplate
        Protected boolValue As CheckBox
        Private colname As String
        Public Sub New(ByVal cName As String)
            colname = cName
        End Sub
        Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
            boolValue = New CheckBox()
            boolValue.ID = "boolValue"
            AddHandler boolValue.DataBinding, _
                       AddressOf boolValue_DataBinding
            boolValue.Enabled = True
            Dim table As New Table()
            container.Controls.Add(table)
            container.Controls.Add(boolValue)
        End Sub
        Sub boolValue_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
            Dim cBox As CheckBox = DirectCast(sender, CheckBox)
            Dim container As Telerik.Web.UI.GridDataItem = DirectCast(cBox.NamingContainer, Telerik.Web.UI.GridDataItem)
            'cBox.Checked = DirectCast((DirectCast(container.DataItem, DataRowView))("Bool"), Boolean)
        End Sub
    End Class

        For Each item As Telerik.Web.UI.GridDataItem In SearchResultGrid.Items
            Dim chk As CheckBox = item.FindControl("boolValue")
            If chk.Checked Then
                Dim j As Integer = 0
            End If
        Next

The problem is that in the For loop chk is getting set to Nothing.   It's not finding the boolValue control.

How do I access the settings of boolValue for each row in the Grid ?
Princy
Top achievements
Rank 2
 answered on 10 Dec 2010
6 answers
338 views
We've used some GridDropDownColumns in RadGrids, but I'm a little confused about sorting. If we sort the column that uses the dropdown, it sorts by the value, and not the text, which is confusing to the user and not the desired result. For example, let's say I have a GridDropDownColumn for Widget, with the following values

ID  Name
-------------
2   Alpha
3   Bravo  
1   Charlie

If I sort by that column, i'd like to see it as Alpha, Bravor, Charlie, however what happens is that it sorts on the value, so it ends up being Charlie, Alpha, Bravo.

Is there a way to have the column sort by the displayed text (the ListTextField) rather than the value field (the ListValueField, my foreign key column).
Derek
Top achievements
Rank 1
 answered on 10 Dec 2010
4 answers
302 views
Hi

I have the RadEditor implemented, everything works, image uploads, deletes, image map,  image editor, etc. However when I right click the image in the content and choose properties I get a Forbidden 403 error. Image Map Editor does however work!

Any ideas?

Michael
Top achievements
Rank 1
 answered on 10 Dec 2010
3 answers
122 views

Hi Telerik,

Really enjoying integrating the Scheduler Control, found the documentation great and control simple to integrate.

I’m using control in the web service mode but have two problems:

1) In Month view when there is more than one appointment in a day slot when "more..." is clicked i would like to handle this and display the timeline view.

2) In the timeline view i would like to switch of the resize handle as im only displaying start dates.

Thanks,

Debbie


Markup:
                <telerik:RadScheduler ID="RadScheduler1" runat="server"                  
                    OnClientAppointmentsPopulating="doClientAppointmentsPopulating" 
                    OnClientAppointmentInserting="doClientAppointmentInserting" 
                    OnClientAppointmentEditing="doClientAppointmentEditing" 
                    OnClientAppointmentDeleting="doClientAppointmentDeleting" 
                    OnClientAppointmentContextMenu="doClientAppointmentContextMenu"   
                    OnClientAppointmentContextMenuItemClicked="doClientAppointmentContextMenuItemClicked"   
                    OnClientTimeSlotContextMenu="doClientTimeSlotContextMenu" 
                    OnClientTimeSlotContextMenuItemClicked="doClientTimeSlotContextMenuItemClicked"   
                    Localization-ConfirmDeleteText="Are you sure you want to delete this announcement." 
                    Localization-ContextMenuAddAppointment="New Announcement"   
                    DisplayDeleteConfirmation="True"   
                    TimelineView-NumberOfSlots="7"   
                    SelectedView="MonthView" 
                    GroupingDirection="Vertical"   
                    FirstDayOfWeek="Monday" 
                    LastDayOfWeek="Sunday" 
                    DataKeyField="ID"   
                    DataSubjectField="Subject"   
                    DataStartField="Start"   
                    DataEndField="End" 
                    DataRecurrenceField="RecurrenceRule"   
                    DataRecurrenceParentKeyField="RecurrenceParentID"     
                    OverflowBehavior="Expand" 
                    ShowAllDayRow="true" 
                    ShowFullTime="false"   
                    ShowViewTabs="true"   
                    StartEditingInAdvancedForm="true"   
                    StartInsertingInAdvancedForm="true">  
                      
                    <WebServiceSettings   
                        Path="~/AdminV9/News/NewsSchedulerWS.asmx"   
                        ResourcePopulationMode="Manual" /> 
 
                    <%-- Header formating --%> 
                    <DayView   
                        UserSelectable="false" /> 
                    <WeekView    
                        UserSelectable="false" /> 
                    <MonthView   
                        UserSelectable="true"   
                        HeaderDateFormat="MMM, yyyy"   
                        AdaptiveRowHeight="false"   
                        VisibleAppointmentsPerDay="2" /> 
                    <TimelineView   
                        UserSelectable="true"   
                        HeaderDateFormat="MMM dd, yyyy"   
                        ColumnHeaderDateFormat="ddd dd" /> 
                    <MultiDayView   
                        UserSelectable="false"  /> 
                      
                    <%-- Context menus --%> 
                    <TimeSlotContextMenuSettings EnableDefault="true" /> 
                    <TimeSlotContextMenus> 
                        <telerik:RadSchedulerContextMenu> 
                            <Items> 
                                <telerik:RadMenuItem Text="New Announcement" Value="CustomAdd" /> 
                                <telerik:RadMenuItem Text="Go to today" Value="CommandGoToToday" /> 
                            </Items> 
                        </telerik:RadSchedulerContextMenu> 
                    </TimeSlotContextMenus> 
 
                    <AppointmentContextMenuSettings EnableDefault="true" /> 
                    <AppointmentContextMenus> 
                        <telerik:RadSchedulerContextMenu> 
                            <Items> 
                                <telerik:RadMenuItem Text="Edit" Value="CommandEdit" /> 
                                <telerik:RadMenuItem Text="Delete" Value="CommandDelete" /> 
                            </Items> 
                        </telerik:RadSchedulerContextMenu> 
                    </AppointmentContextMenus> 
                      
                    <%--Forms --%> 
                    <AdvancedForm Modal="true" /> 
 
                </telerik:RadScheduler> 
Kevin
Top achievements
Rank 1
 answered on 10 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?