Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
220 views

We have wrapped the .Net TreeList control for our application. Once the ASP page is loaded and starts execution, we get on error stating that the ClientSettings.ClientEvents handlers are undefined. We have tried declaring the event handlers in the TreeList declaration of the TreeList in the .ascx file and setting the event handlers at run time in the .ascx.vb file.

We tried registering the client scripts which I don’t like having to place an entire function in a string. We have placed the reference function in the .ascx file and in a separate file which is then included in the outer .aspx file.

We have just upgraded to the latest version last week. I’m not sure what version. From Visual Studio, the Telerik About menu doesn’t display version information, just an advertisement.

 

What is the proper method of creating a user control with client side event handlers? We found several similar questions posted, but none of the answers appear to work for this version.

Antonio Stoilkov
Telerik team
 answered on 14 Dec 2011
1 answer
221 views
Hi,

I have a RadBinaryImage control on my aspx page. using to display image.

I have stored my img file in sqldb as nvarbinary(max). I am retrieving the img from db table as byte[] and setting to RadBinaryImage control.

RadBinaryImage1.DataValue = imgsource;

imgsource is byte[].

But its throwing error as below.

Can any one tell me where am going wrong?

Thanks,

Parameter is not valid.

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.ArgumentException: Parameter is not valid.

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.
Antonio Stoilkov
Telerik team
 answered on 14 Dec 2011
4 answers
259 views
Hi,

I have a strange issue.

I have a form that has multiple RadGrids. On a few of these Grids I have a Delete Command which would delete that particular row.

When the delete command is called, the appropriate event is fired and the code is executed correctly. The right row gets deleted from the database. However, when the control refreshes, it results in an empty grid. If I refresh the entire page, the grid will show the correct number of rows.

I've used the delete command on many other forms without this issue. and I'm stuck on what could be the cause.

Anyone else had the issue when the Delete Command is fired that the grid displays no rows, even though the database rows are there?

Thanks
JM
Paul
Top achievements
Rank 1
 answered on 14 Dec 2011
1 answer
44 views
Hello,

There is not any record available in this link.

for more info check attached image.

Thanks,
Jayesh Goyani
Jayesh Goyani
Top achievements
Rank 2
 answered on 14 Dec 2011
1 answer
80 views
I'm having a weird problem with some of the RadGrids I'm using. Certain columns appear all in white and without any controls in them when in edit mode. This happens in IE, Chrome, and Firefox (except the column is yellow in Firefox), and I don't understand why.

You can see 2 pics of the grid attached below. One is in read only mode, and the other is in edit mode. Do notice that I am using inplace editing and making all of the rows editable.

Here's the aspx code (I renamed some column and control names).

<telerik:RadGrid ID="radgrid1" AutoGenerateColumns="False" runat="server"
    GridLines="None" Skin="Office2007" CellSpacing="0" DataSourceID="radgrid1DataSource"
    OnItemInserted="radgrid1_ItemInserted" AllowAutomaticInserts="true"
    OnItemDataBound="radgrid1_ItemDataBound" OnItemCommand="radgrid1_ItemCommand"
    AllowAutomaticDeletes="true" ValidationSettings-EnableValidation="false">
    <MasterTableView DataKeyNames="KeyID" EditMode="InPlace" AllowAutomaticInserts="true"
        AllowAutomaticDeletes="true">
        <Columns>
            <telerik:GridBoundColumn DataField="KeyID" Visible="false" UniqueName="KeyID"
                HeaderText="<%$ Resources:GlobalResources, KeyID %>" />
            <telerik:GridBoundColumn DataField="ProjectID" Visible="false" UniqueName="ProjectID"
                HeaderText="<%$ Resources:GlobalResources, ProjectID %>" />
            <telerik:GridBoundColumn DataField="Name" UniqueName="Name"
                HeaderText="<%$ Resources:GlobalResources, Name%>" />
            <telerik:GridNumericColumn DataField="InitialAmount" NumericType="Number"
                DataFormatString="{0:N}" DecimalDigits="2" UniqueName="InitialAmount"
                HeaderText="<%$ Resources:GlobalResources, InitialAmount%>" />
            <telerik:GridTemplateColumn UniqueName="CurrencyCode" ItemStyle-Width="260px"
                HeaderText="<%$ Resources:GlobalResources, CurrencyCode %>">
                <ItemTemplate>
                    <%# DataBinder.Eval(Container.DataItem, "CurrencyCode") %>
                </ItemTemplate>
                <EditItemTemplate>
                    <cc:CurrencyDropDownList ID="ddlCurrency" runat="server" IsAlertsVisible="false"
                        IsLockVisible="false" IsHistoryVisible="false" IsFieldLabelVisible="false" IsReadOnly="false"
                        IncludeNullValue="false" MyDropDownList-SelectedValue='<%# Bind("CurrencyCode") %>' />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
             
            <telerik:GridCheckBoxColumn DataField="ToDelete" UniqueName="ToDelete" HeaderText="Delete" />
            <telerik:GridEditCommandColumn ButtonType="PushButton" InsertText="Confirm" EditText="Edit"
                CancelText="Cancel" UniqueName="EditCommandColumn" />
        </Columns>
        <NoRecordsTemplate>
            No Records Found.
        </NoRecordsTemplate>
        <CommandItemTemplate>
            <table cellpadding="5" style="width: 100%">
                <tr>
                    <td align="left">
                        <asp:LinkButton ID="btnAddNewRecord" runat="server" CommandName="InitInsert">
                            <img style="border:0px" alt="" src="../Images/add.png" />Add New Record
                        </asp:LinkButton>
                    </td>
                    <td align="right">
                        <asp:LinkButton ID="btnDeleteSelected" runat="server" CommandName="DeleteSelected"
                            OnClientClick="javascript:return confirm('Delete all selected records?')">
                            <img src="../Images/delete.png" alt="" style="border:0px" />Delete Selected
                        </asp:LinkButton>
                    </td>
                </tr>
            </table>
        </CommandItemTemplate>
    </MasterTableView>
</telerik:RadGrid>


Here's some of the only relevant C# code (i.e. relevant to the ToDelete column and the grid itself):

protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsInEditMode)
            {
                for (int i = 0; i < this.radgrid1.PageSize; i++)
                {
                    this.radgrid1.EditIndexes.Add(i);
                }
 
                this.radgrid1.Columns.FindByUniqueName("ToDelete").Visible = true;
                this.radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Bottom;
            }
            else
            {
                this.radgrid1.Columns.FindByUniqueName("ToDelete").Visible = false;
                this.radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
            }
        }
 
protected void radgrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e != null)
            {
                if (e.Item is GridDataItem && !e.Item.IsInEditMode)
                {
                    GridDataItem item = e.Item as GridDataItem;
                    Button editButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0];
                    editButton.Visible = false;
                }
                else if (e.Item is GridDataInsertItem && e.Item.IsInEditMode)
                {
                    GridDataInsertItem item = e.Item as GridDataInsertItem;
                    Button insertButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0];
                    Button cancelButton = (Button)item.Controls[item.Controls.Count - 1].Controls[2];
                    insertButton.Visible = true;
                    cancelButton.Visible = true;
                }
                else if (e.Item is GridDataItem && e.Item.IsInEditMode)
                {
                    GridEditableItem item = e.Item as GridEditableItem;
                    Button editButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0];
                    Button cancelButton = (Button)item.Controls[item.Controls.Count - 1].Controls[2];
                    editButton.Visible = false;
                    cancelButton.Visible = false;
                }
            }
        }


Basically, when I'm in readonly mode, I hide the ToDelete column, the Edit/Update/Cancel buttons and I do not display the commanditem controls.

In Edit mode, I display the ToDelete column and hide the Edit/Update/Cancel buttons. On the other hand, I display the command item controls.

Any help?

Thanks.
Pavlina
Telerik team
 answered on 14 Dec 2011
2 answers
199 views
I'm adding a dropdown filter control as a usercontrol. Basically like the demo at http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx but take the RadComboBox and script and put them into a usercontrol. See code block

<telerik:GridHyperLinkColumn .... UniqueName="CustomerNumber" Groupable="False">
   <FilterTemplate>
      <vtx:GridFilter ID="CustNumFilter" Field="CustomerNumber" runat="server"/>
   </FilterTemplate>
</tlk:GridHyperLinkColumn>

I need to get access to the usercontrol programmatically to add the data to it but I cannot figure out how and where to do this.

Thanks

Colin Blakey

ColinBlakey
Top achievements
Rank 2
 answered on 14 Dec 2011
1 answer
112 views
The Load event gets fired as is's supposed to be. Why isn't the AppointmentDataBound event fired?
Ivana
Telerik team
 answered on 14 Dec 2011
21 answers
281 views
Hi,
I am using Telerik Q2 2009 RadScheduler together with RadTooltip as described in LiveDemos.Here is  the code of my control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="monthschedule.ascx.cs" Inherits="com.epam.epm3ie.uc.artist.MonthSchedule" %> 
<%@ Reference Control="tooltip.ascx" %> 
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional" > 
    <ContentTemplate> 
        <telerik:RadScheduler runat="server" ID="radScheduler" Width="750px" DayStartTime="09:00:00" DayEndTime="22:00:00"   
            DataKeyField="UniqueID" DataSubjectField="eventName" DataStartField="startTime" DataEndField="endTime" 
            MonthView-VisibleAppointmentsPerDay="10" Culture="<%# UserCulture %>" FirstDayOfWeek="<%# UserFirstDayOfWeek %>" 
            SelectedView="MonthView" AllowDelete="false" MonthView-AdaptiveRowHeight="true" MonthView-HeaderDateFormat="MMMM yyyy" 
            OverflowBehavior="Expand" OnAppointmentDataBound="radScheduler_AppointmentDataBound" 
            StartEditingInAdvancedForm="false" OnClientAppointmentInserting="OnClientAppointmentInserting" 
            OnClientAppointmentEditing="OnClientAppointmentEditing" OnNavigationComplete="radScheduler_NavigationComplete"   
            OnAppointmentCreated="radScheduler_AppointmentCreated" OnDataBound="radScheduler_DataBound">  
            <Localization AdvancedAllDayEvent="All day"></Localization> 
            <AdvancedForm Modal="true" /> 
            <TimelineView UserSelectable="false" /> 
        </telerik:RadScheduler> 
        <telerik:RadToolTipManager runat="server" ID="radToolTipManager" Width="320" Height="170" 
        Animation="None" HideEvent="LeaveToolTip" Text="Loading..." 
        OnAjaxUpdate="radToolTipManager_AjaxUpdate" OnClientBeforeShow="clientBeforeShow" /> 
    </ContentTemplate> 
</asp:UpdatePanel> 

And the problrem is that when you try to navigate the scheduler in month view (change day to the another month or navigate month to next or previous using buttons < >) the content of the scheduler doesn't redraw. It looks like the month has changed, by there are no any appointment and cells of scheduler are absolutely empty even without date in the corner. But when you just move mouse pointer over the cells of scheduler, the wright appointmets draw in the cells. It is strange, but this situation take place only in Month view - in week view or day view everething is ok.  Other brousers like FireFox, Opera and even IE6 alwas redraw scheduler content.

Another problem relate to the appointment style in Month View of scheduler - in the IE6 and IE8 the appointment name doesn't cut if it is longer than the cell, this looks not good - scrollbars appear in IE, and borders of the vertical columns of days are shifted relative to the week day names in the top of scheduler. 
Helen
Telerik team
 answered on 14 Dec 2011
1 answer
82 views

Hi
I'd like some guidance on the best approach to solve a problem with a rad dropdown field in a rad grid.

I have an aspx page in which there is a rad tabstrip with two radtabs.

The contents of the selected rad tab is a radgrid that is programmatically generated ON THE SERVER SIDE, in the code behind.

Each row in the grid can be edited.  The editing feature is implemented by a button in the grids command panel labeled Edit.
When pressed, an ItemDataBound event is fired on the server side, it then seeks the column to be converted to a dropdown, in the currently selected row and modifies it into a  radcombobox.  I'm new to telerik so I'm not certain if the radcombox has a text mode for display and a dropdown for edit.  It does not appear that the specific cell has a unique name, it is identified by selected row and column name only.

My issue is that often, the width of the column is less than the width of the GridDropDown control resulting in the drown down button on the right of the control to not appear unless the width of the column is increased.  The documentation suggests that the way to correct this is to issue a repaint() of the client side control. 

I have several questions:
Since this conversion of the display from text to dropdown is done on the server side, how do obtain the client side control to issue a repaint()?
Is there jquery selector that will just find all the raddropdown controls on the page and refresh them all (sort of like selecting all div tags)?  What is the syntax? and how do I fire it after the server side has made the change to edit mode?

Thanks.  I really appreciate all suggestions.

Andrey
Telerik team
 answered on 14 Dec 2011
3 answers
100 views
The new Group Header Templates functionality in Q3 2011 appears to have broken some of the functionality which worked before. I define my groupinsettings server-side as such:
Dim fId As New GridGroupByField
 fId.FieldName = "ID"
 fId.Aggregate = GridAggregateFunction.Count
 fId.FormatString = "({0})"
 fId.HeaderValueSeparator = " "
 fId.HeaderText = " "
 
Dim expr As New GridGroupByExpression
Dim fState As New GridGroupByField
fState.FieldAlias = "State"
fState.FieldName = "GroupState"
fState.FormatString = "{0}"
 
expr.SelectFields.Add(fState)
expr.SelectFields.Add(fId)
 
Dim fGroupState As New GridGroupByField
fGroupState.FieldName = "GroupState"
expr.GroupByFields.Add(fGroupState)
 
MyGrid.MasterTableView.GroupByExpressions.Add(expr)


In q2 it looked like the attached q2.jpg. In Q3 it look slike the attached q3.jpg. There is no difference in code.
Martin
Telerik team
 answered on 14 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?