Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
142 views

I have a radgrid that I am dynamically creating in the Page_Init method as mentioned here. I have multiple templated columns that dispaly a label in the ItemTemplate and a RadComboBox and RadTimePicker in the EditItemTemplate. Both are properly displayed. However, on editing in batch mode, I am only able to get the value of the radcombobox and not of the time picker. I have noticed that the DataBinding events of my EditItemTemplate controls do not fire at all. Even the overridden ExtractValues method doesnt hit my breakpoint. Have attached the code..Any help is appreciated.

public class MyItemTemplate : IBindableTemplate
    {
        protected Label lblProj;
 
        private string colName;
 
 
        public MyItemTemplate(string cName)
        {
            colName = cName;
 
        }
 
        public void InstantiateIn(System.Web.UI.Control container)
        {
            lblProj = new Label();
            lblProj.ID = "ProjTime_" + colName;
            lblProj.Width = Unit.Pixel(140);
            lblProj.DataBinding += new EventHandler(lblProj_DataBinding);
            container.Controls.Add(lblProj);
        }
 
        void lblProj_DataBinding(object sender, EventArgs e)
        {
            Label lblProj = (Label)sender;
            GridDataItem container = (GridDataItem)lblProj.NamingContainer;
            lblProj.Text = ((DataRowView)container.DataItem)[colName].ToString();
        }
 
        public IOrderedDictionary ExtractValues(Control container)
        {
            OrderedDictionary values = new OrderedDictionary();
            return values;
        }
 
    }
public class MyEditTemplate : ITemplate
   {
       protected RadComboBox PDay;
       protected static string date;
       protected static string time;
       protected RadTimePicker PTime;
       private string colName;
       
       public MyEditTemplate(string cName)
       {
           colName = cName;
           
       }
 
       public IOrderedDictionary ExtractValues(Control container)
       { //breakpoint here doesnt get hit
           OrderedDictionary values = new OrderedDictionary();
                       return values;
       }
 
       
       public void InstantiateIn(System.Web.UI.Control container)
       {
           PDay = new RadComboBox();
           PDay.ID = "PDay_" + colName;
           PDay.Width = Unit.Pixel(150);
           PDay.AllowCustomText = true;
           PDay.DataBinding += new EventHandler(PDay_DataBinding);
 
           //adding Items to PDay.Items here
 
           PTime = new RadTimePicker();
           PTime .ID = "PTime_" + colName;
           PTime .Width = Unit.Pixel(100);
           PTime .DataBinding += new EventHandler(PTime_DataBinding);
           PTime .DateInput.ReadOnly = true;
 
           container.Controls.Add(PDay);
           container.Controls.Add(PTime );
 
       }
 
       void PTime_DataBinding(object sender, EventArgs e)
       { //breakpoint here doesnt get hit
           RadTimePicker timePicker = (RadTimePicker)sender;
           GridDataItem container = (GridDataItem)timePicker.NamingContainer;
           timePicker.SelectedDate = Convert.ToDateTime(((DataRowView)container.DataItem)[colName].ToString());
                   }
 
 
       public void PDay_DataBinding(object sender, EventArgs e)
       { //breakpoint here doesnt get hit
           RadComboBox cBox = (RadComboBox)sender;
           GridDataItem container = (GridDataItem)cBox.NamingContainer;
           cBox.Text = ((DataRowView)container.DataItem)[colName].ToString();
         }
 
 
 
   }

Angel Petrov
Telerik team
 answered on 26 Oct 2015
5 answers
157 views
Hello,

In order to integrate RadUpload control with SharePoint 2010 (IIS 7.5) I wrote an application page MyCustomUpload.aspx:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register Tagprefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyCustomUpload.aspx.cs" Inherits="LargeFileUploadSP.Layouts.LargeFileUploadSP.MyCustomUpload" DynamicMasterPageFile="~masterurl/default.master" %>
 
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
 
</asp:Content>
 
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <telerik:RadProgressManager ID="Radprogressmanager1" runat="server" />
     
    <table>
        <tr>
            <td>
                <telerik:RadUpload ID="RadUpload1" runat="server" />
            </td>
            <td>
                <div>
                    <asp:Label ID="labelNoResults" runat="server" Visible="True">No uploaded files yet</asp:Label>
                    <asp:Repeater ID="repeaterResults" runat="server" Visible="False">
                        <HeaderTemplate>
                            <div>Uploaded files in the target folder:</div>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                            <%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>
                            <br />
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
            </td>
        </tr>
    </table>
 
    <div class="submitArea">
        <asp:Button runat="server" ID="SubmitButton" Text="Upload files" OnClick="SubmitButton_Click" />
    </div>
    <telerik:RadProgressArea runat="server" ID="ProgressArea1">
    </telerik:RadProgressArea>
</asp:Content>
 
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
My custom upload page
</asp:Content>
 
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My custom upload page
</asp:Content>

with code behind cs:

using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI;
using Telerik.Web.UI;
 
namespace LargeFileUploadSP.Layouts.LargeFileUploadSP
{
    public partial class MyCustomUpload : LayoutsPageBase
    {
        private ScriptManager scriptManager;
         
        protected void Page_Load(object sender, EventArgs e)
        {
            RadUpload1.TargetPhysicalFolder = @"C:\telerik_uploads\";
        }
 
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            if (RadUpload1.UploadedFiles.Count > 0)
            {
                repeaterResults.DataSource = RadUpload1.UploadedFiles;
                repeaterResults.DataBind();
                labelNoResults.Visible = false;
                repeaterResults.Visible = true;
            }
            else
            {
                labelNoResults.Visible = true;
                repeaterResults.Visible = false;
            }
        }
    }
}

I'm using the standard .net ScriptManager provided in default SP master page.
I was able to upload files with no additional configuration but no progress bar was displayed and I received a warning pop-up every time the file was uploaded. Following these instructions (for IIS7): http://www.telerik.com/help/aspnet-ajax/moss-progress-area-in-moss.html and http://www.telerik.com/help/aspnet/upload/uploadinglargefiles.html I configured the progress handler and upload limits.

Here are some parts of my web.config file (for SP web app):

<system.webServer>
    <security>
        <requestFiltering allowDoubleEscaping="true">
            <requestLimits maxAllowedContentLength="2147483647" />
        </requestFiltering>
    </security>
    ...
    <httpRuntime maxRequestLength="1024000" executionTimeout="3600" />
    ...
    <modules runAllManagedModulesForAllRequests="true">
        ...
        <!-- For Telerik RadUpload control -->
        <add name="RadUploadHttpModule" type="Telerik.Web.UI.SPRadUploadHttpModule, Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode" />
    </modules>
    <handlers>
        ...
        <!-- For Telerik RadUpload control -->
        <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" preCondition="integratedMode" name="Telerik_RadUploadProgressHandler_ashx" />
    </handlers>
</system.webServer>
<location path="Telerik.RadUploadProgressHandler.ashx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization >
    </system.web>
</location>
<location path="WebResource.axd">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization >
    </system.web>
</location>
<location path="Telerik.Web.UI.WebResource.axd">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>

I've also changed the C:\Windows\System32\inetsrv\config\applicationHost.config file as described in documentation:

<section name="requestFiltering" overridemodedefault="Allow" />

in all sectionGroups where it occurred.

Now when I'm trying to upload a file I get 404 and no files are uploaded to target folder.

Logs from IIS:

--- begin ---

2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 GET /sites/test/Telerik.RadUploadProgressHandler.ashx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef&RadUploadTimeStamp=1325247928752& 10001 - fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 401 1 2148074254 1
2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 POST /sites/test/_layouts/LargeFileUploadSP/MyCustomUpload.aspx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef 10001 - fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 401 1 2148074254 14
2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 GET /sites/test/Telerik.RadUploadProgressHandler.ashx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef&RadUploadTimeStamp=1325247928752& 10001 DEVMM\Administrator fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 200 0 0 14
2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 POST /sites/test/_layouts/LargeFileUploadSP/MyCustomUpload.aspx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef 10001 DEVMM\Administrator fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 404 0 0 117

--- end ---

I've read some posts on this forum related with RadUpload and http 404 problems but none of them were helpful in my case.

Could you please help me to solve this problem?

Best regards
Marek Mierzwa
Gaurav
Top achievements
Rank 1
 answered on 26 Oct 2015
4 answers
174 views

Hi Telerik Team

I am getting the combo Box Design different in Chrome and Firefox and i haven't tried with other browsers  Check the ​attached image for clear idea.

Actually the design come perfect in chrome and  as coming to Firefox the text is displayed in next line.

Please help to solve this .

Thank You in Advance .

seshaadhree
Top achievements
Rank 1
 answered on 26 Oct 2015
2 answers
293 views

The scenarios:

I have a MasterTableView and it contains one DetailsTable. And the GridTableView contains a button in its CommandItemTemplate section. I want to fetch the parent table ID (MasterTableView) against the button click in the hierarchical child table (GridTableView). The e.CommandArgument property in the grid's ItemCommand event is empty.

 

The markup for the CommandItemTemplate is below:

 

<CommandItemTemplate>
                                <div style="padding: 5px 5px; text-align:right" >
                                    <asp:Button ID="btnSaveAction" runat="server" SkinID="Save" 
                                        CausesValidation="false" Text='​Save'  CommandName="​Save" CommandArgument='<%# Eval("ID") %>' />
                                </div>
                            </CommandItemTemplate>​

Nabeel
Top achievements
Rank 1
 answered on 24 Oct 2015
10 answers
1.0K+ views
I want to have a column in my rad grid that contains dropdown list.

I added (based on your examples):

<telerik:RadGrid ID="gvWebUsers" runat="server" OnNeedDataSource="gvWebUsers_NeedDataSource" OnItemCreated="gvWebUsers_ItemCreated"
                    Skin="Gray" AutoGenerateColumns="false"
                    OnItemDataBound="gvWebUsers_ItemDataBound" AllowAutomaticUpdates="true"
                    AllowPaging="true" CssClass="SettingsGrid" 
                    Width="99.7%">
                    
                    <ClientSettings Resizing-AllowColumnResize="true" Resizing-ClipCellContentOnResize="true" />
                    
                    <MasterTableView DataKeyNames="UserID" PageSize="15" EditMode="InPlace" >
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <Columns>
                             <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="<%$ Resources:English,Settings_MobilityUsers_Email %>"
                                UniqueName="EmailAddress" />
                                
                             <telerik:GridBoundColumn DataField="FirstName" HeaderText="<%$ Resources:English,Settings_MobilityUsers_FirstName %>"
                                UniqueName="FirstName" />
                                
                             <telerik:GridBoundColumn DataField="LastName" HeaderText="<%$ Resources:English,Settings_MobilityUsers_LastName %>"
                                UniqueName="LastName" />
                        
                             <telerik:GridBoundColumn DataField="IsDomainUser" HeaderText="<%$ Resources:English,Settings_MobilityUsers_IsDomainUser %>"
                                UniqueName="IsDomainUser" />
                                
                             <telerik:GridBoundColumn DataField="IsVerified" HeaderText="<%$ Resources:English,Settings_MobilityUsers_IsVerified %>"
                                UniqueName="IsVerified" />
                                
                             <telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="BlockButton" />
                             
                             <telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="ChangePassButton" />

                            <telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="AllowUploadButton" />
                             
                             <telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="UnlockButton" />




                    <telerik:GridTemplateColumn HeaderText="Category" ItemStyle-Width="240px">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "IsUploadAllowed")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadComboBox runat="server" ID="RadComboBox2" DataTextField="IsUploadAllowed"
                                DataValueField="IsUploadAllowed" SelectedValue='<%#Bind("IsUploadAllowed") %>'>
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridEditCommandColumn FooterText="EditCommand footer" UniqueName="EditCommandColumn"
                        HeaderText="Edit" HeaderStyle-Width="100px" UpdateText="Update">
                    </telerik:GridEditCommandColumn>

                            
                            
                        </Columns>
                        
                    </MasterTableView>
                </telerik:RadGrid>

But when I press on "Update" I get an error.
In addition, how can I bind data to the rad combobox from server side? (like itemdatabound)? Is there any way to call server side function on update command?





Meenakshi
Top achievements
Rank 1
 answered on 24 Oct 2015
5 answers
581 views
I have RadGrid inside of RadWindows. I need to refresh RadGrid every time when RadWindow shows. How to do it?
<script type="text/javascript">
    function closeCustomConfirm() {
        $find("<%=rwApproveInstance.ClientID %>").close();
    }
    function ShowRadWindow() {
        var oWnd = $find("<%=rwApproveInstance.ClientID %>");
        oWnd.show();
    }
</script>
<telerik:RadWindowManager runat="server" ID="RadWindowManager1" >
    <Windows>
        <telerik:RadWindow ID="rwApproveInstance" Modal="true" Behaviors="Close, Move" VisibleStatusbar="false"
            Width="800px" Height="700px" runat="server" ReloadOnShow="True" ShowContentDuringLoad="False">
            <ContentTemplate>
                <div class="rwDialogPopup radconfirm">
                    <div>
                        <telerik:RadGrid ID="rgApprovalInstance" runat="server" AutoGenerateColumns="False"
                            CellSpacing="0" GridLines="None" OnNeedDataSource="rgApprovalInstance_NeedDataSource">
                            <MasterTableView DataKeyNames="FieldName">
                                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" FilterControlAltText="Filter FieldName column"
                                        Groupable="False" HeaderText="FieldName" UniqueName="FieldName" DataField="FieldName">
                                        <HeaderStyle CssClass="documents-table" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" DataField="FieldValue"
                                        FilterControlAltText="Filter FieldValue column" Groupable="False" HeaderText="FieldValue"
                                        ReadOnly="True" UniqueName="FieldValue">
                                        <HeaderStyle CssClass="documents-table" />
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </div>
                    <div>
                        <telerik:RadButton runat="server" ID="rbConfirm_Cancel" Text="Close" OnClientClicked="closeCustomConfirm">
                        </telerik:RadButton>
                    </div>
                </div>
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
Oleg
Top achievements
Rank 1
 answered on 23 Oct 2015
1 answer
183 views

i tried that code without radgrid and is working fine

  <script type="text/javascript">
                                      function sum() {
                         var txtFirstNumberValue = document.getElementById('txt1').value;
                         var txtSecondNumberValue = document.getElementById('txt2').value;
                         var result = parseInt(txtFirstNumberValue) + parseInt(txtSecondNumberValue);
                         if (!isNaN(result)) {
                             document.getElementById('txt3').value = result;
                         }
                     }                                       
        </script>           

 

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Not Page.ClientScript.IsStartupScriptRegistered("test")) Then
            Page.ClientScript.RegisterStartupScript(Me.GetType(), "test", "sum();", True)
        End If
    End Sub

 

But my problem was that i'm working with radgrid editform template, i have same 3 text boxes inside radgrid editform template, how to implement the above scenario with radgrid editform template
​

Konstantin Dikov
Telerik team
 answered on 23 Oct 2015
2 answers
153 views

I'm trying to do a fluid slider where it adjust to screen size. According to the fluid design documentation, if I were to add the control on page, I simply need to set: Width="100%" RenderMode="Lightweight":

http://docs.telerik.com/devtools/aspnet-ajax/controls/slider/mobile-support/responsive,-adaptive-and-elastic-capabilities#fluid-design-with-radslider

This work fine, but I need to create the sliders dynamically. The problem here is when creating in code behind, the Width property is integer only, I can't set to percent, so it can only be set to pixels. Any workaround?

Thanks

Aaron

Aaron
Top achievements
Rank 1
 answered on 23 Oct 2015
2 answers
99 views

Hi,

How to fire an OnItemClick event of a RadMenu from code-behind?

Thank you,

ETS

ETS
Top achievements
Rank 1
 answered on 23 Oct 2015
1 answer
125 views

New to the forums so hello to all.  I have been using Telerik components for about 6 months now and have noticed an occasional hiccup with the scheduler and (I believe exclusively) IE.  

I have attached a file with the worst case scenario.  All of the contents of the calendar are squashed to the left of the view which results in a vertical blue line. Sometimes it is less severe with about 50% white space and 50% of the actual calendar so that the information can still be discerned, but just barely. This is not consistently reproducible for me and what works on one machine may not work on another with the same website and browser version.

Has anyone else experienced this? Are there any known IE tweaks or anything to help assist with this problem? I did a search but did not find anything pertaining to this issue so I appreciate any feedback. I am using product version 2010.3.1317.40

 â€‹

Marin Bratanov
Telerik team
 answered on 23 Oct 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?