Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
47 views
Hi All,

I am new to this community and need some help with rad window.
I have created a rad window using ParentGrid context menu. The value entered in rad window should be reflected in the parent grid after closing the rad window.
As of now, the value entered in rad window is changed in DB but the same is not in parent grid. The values is shown only after refreshing but i need to show the value when the window is closed.

Kindly do help ASAP.

Thanks in advance.
Svetlina Anati
Telerik team
 answered on 09 Feb 2012
3 answers
58 views
Hi,
I'm using a SqlDataSource for my RadGrid and I can't edit the data, it's not updating in my database.
What do I have to add to my code?


Thanks in advance,
esmyy
Andrey
Telerik team
 answered on 09 Feb 2012
4 answers
417 views
I need to change the default small textbox to a textarea in edit mode ( inline) and it's not working, the textarea shows up when i use a template column but when it tries to update the textarea value it throws an error because it cannot find the value even though I set up Update params in the SQL datasource. Is there any sample projects that do this? I am wondering if it cannot find the value because I am using master pages.

Here is the code for the grid:

<telerik:RadGrid ID="rgNews" runat="server" CellSpacing="0"
                    DataSourceID="sdsNews" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" GridLines="None" AllowPaging="True"
                    AllowSorting="True" AutoGenerateColumns="False">
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
<MasterTableView DataKeyNames="newsID" CommandItemDisplay="Top" AllowAutomaticInserts="true" DataSourceID="sdsNews">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="newsID" DataType="System.Int32"
            FilterControlAltText="Filter newsID column" HeaderText="newsID"
            ReadOnly="True" SortExpression="newsID" UniqueName="newsID"
            Visible="False">
        </telerik:GridBoundColumn>
        <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelText=""
            FilterControlAltText="Filter EditCommandColumn column"
            UpdateText="">
        </telerik:GridEditCommandColumn>
        <telerik:GridBoundColumn DataField="Title"
            FilterControlAltText="Filter Title column" HeaderText="Title"
            SortExpression="Title" UniqueName="Title">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Date"
            FilterControlAltText="Filter Date column" HeaderText="Date"
            SortExpression="Date" UniqueName="Date">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Author"
            FilterControlAltText="Filter Author column" HeaderText="Author"
            SortExpression="Author" UniqueName="Author">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Publication"
            FilterControlAltText="Filter Publication column" HeaderText="Publication"
            SortExpression="Publication" UniqueName="Publication">
        </telerik:GridBoundColumn>
       <%-- <telerik:GridBoundColumn DataField="Content"
            FilterControlAltText="Filter Content column" HeaderText="Content"  Visible="False"
            SortExpression="Content" UniqueName="Content">
        </telerik:GridBoundColumn>--%>
        <telerik:GridTemplateColumn UniqueName="Content" DataField="Content"  HeaderText="Content" Visible="false">
        <ItemTemplate>
        <asp:Label ID="lblContent" Text='<%# Bind("Content") %>' runat="server" />
        </ItemTemplate>
        <EditItemTemplate>
        <asp:TextBox ID="txtContent" TextMode="MultiLine" Text='<%# Eval("Content") %>' Height="150" Width="200" runat="server"></asp:TextBox>
        </EditItemTemplate>
        </telerik:GridTemplateColumn>
         <telerik:GridBoundColumn DataField="Link"
            FilterControlAltText="Filter Link column" HeaderText="Link"
            SortExpression="Link" Visible="false" UniqueName="Link">
        </telerik:GridBoundColumn>
        <telerik:GridButtonColumn CommandName="Delete" Text="Delete" ButtonType="ImageButton"
      UniqueName= "DeleteColumn" />
    </Columns>
 
<EditFormSettings CaptionFormatString="Edit news details for {0}" FormCaptionStyle-Font-Bold="true" FormCaptionStyle-ForeColor="#9d273f" CaptionDataField="Title">
<EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="ImageButton"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
                </telerik:RadGrid>

Here is the SQL Datasource code:

<asp:SqlDataSource ID="sdsNews" runat="server"
       ConnectionString="<%$ ConnectionStrings:CLSWEBConnectionString %>"     
       SelectCommand="SELECT [newsID], [Title], [Date], [Author], [Publication], [Content], [Link] FROM [tblNews]"
       UpdateCommand="UPDATE [tblNews] set [Title] = @Title, [Date] = @Date, [Author] = @Author, [Publication] = @Publication, [Content] = @Content, [Link] = @Link WHERE [newsID] = @newsID"
       DeleteCommand="DELETE FROM [tblNews] WHERE [newsID] = @newsID">
       <UpdateParameters>
       <asp:Parameter Name="Content" Type="String" />
       </UpdateParameters>
   </asp:SqlDataSource>



Here is the error it throws, I am guessing it cannot find the value of the Content template column:

Cannot insert the value NULL into column 'Content', table 'CLSWEB.dbo.tblNews'; column does not allow nulls. UPDATE fails.
The statement has been terminated.






Thanks,
Sam
Sam
Top achievements
Rank 1
 answered on 09 Feb 2012
1 answer
174 views
Dear Telerik Support

I need to Fire the event SelectedIndexChanged on my RadComboBox only if the user selects something on the list, rather than typing something on it. Is it possible? If you need more information, please let me know.
Kate
Telerik team
 answered on 09 Feb 2012
0 answers
67 views
I created a web forms application that used controls from AJAX Q3 2009.  That application was never released at that time.  Now we are planning to go back and start working on it again.  I want to use the latest control versions Q3 2011 SP1 (v2011.3.1305, Jan. 6, 2012).
Is there any known issues in doing this upgrade?  I need to figure out if it's worth upgrading to the latest controls or not.

thank you
jerry
Top achievements
Rank 1
 asked on 09 Feb 2012
1 answer
97 views
I'm not sure if this is something in our CSS that's causing this or not...

If I set my treeview to disabled, the nodes seem to be a gray color, but have a white shadow. I've attached a picture of what I'm seeing. it's easier to see the "shadow" on the selected node, but it is visible on the non selected nodes too. Any idea what's causing this?

On a tangent, is there any way to prevent the user from selecting different nodes and collapsing nodes other than just totally disabling the entire treeview?
Bozhidar
Telerik team
 answered on 09 Feb 2012
2 answers
66 views

I am having a strange problem that I can reproduce.  I have a Windows 2008 R2 server with the default Document setup to bring up the default.aspx page.  I am running the latest build of the Telerik controls.

On my default.aspx page all I have on the page is the RadScriptManager, RadAjaxLoadingPanel, RadAjaxPanel and a asp button inside the RadAjaxPanel.  The RadAjaxPanel is set with the LoadingPanelID of the RadAjaxLoadingPanel.

On the button click event I have System.Threading.Thread.Sleep(5000) this is to just have the loading panel display the loading image just to make a simple test.

This all works just if I call the http://sitename/default.aspx page, but if I just call the http://sitename and have the server load the default document “default.aspx “ the loading panel will not function and display the image.  The problem only occurs on Windows server 2008 R2.  I do not have the problem on Windows server 2008 or Windows 7.

I have contacted Telerik support and they have basically told me this is my problem, even though I have recreated this on 3 different Windows 2008 R2 servers and 2 different projects.  So I guess I am just wondering if any of you have seen this problem or you could test this and see if this is really just me. 

Thanks for any help

Mark

 

</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <div>
 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"
            Skin="Default">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px"
            HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1" width="300px">
            <asp:Button ID="Button1" runat="server" Text="Button" />
        </telerik:RadAjaxPanel>
        <br />
 
    </div>
    </form>
</body>
</html>


Imports Telerik.Web.UI
 
Partial Class _Default
    Inherits System.Web.UI.Page
 
    Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
        System.Threading.Thread.Sleep(5000)
    End Sub
End Class

Web.Config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appSettings>
        <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled" />
        <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled" />
    </appSettings>
    <system.web>
        <compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
        <pages>
            <controls>
                <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
            </controls>
        </pages>
        <httpHandlers>
 
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
        </httpHandlers>
        <httpModules>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
 
        </httpModules>
    </system.web>
 
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
            <remove name="RadUploadModule" />
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" />
            <remove name="RadCompression" />
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" />
 
        </modules>
        <handlers>
 
            <remove name="ChartImage_axd" />
            <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
            <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
            <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
            <remove name="Telerik_Web_UI_DialogHandler_aspx" />
            <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
            <remove name="Telerik_RadUploadProgressHandler_ashx" />
            <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
            <remove name="Telerik_Web_UI_WebResource_axd" />
            <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
        </handlers>
        <defaultDocument>
            <files>
                <clear />
                <add value="default.aspx" />
                <add value="MaintenanceEntry.aspx" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="index.html" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>
Mark Andrew
Top achievements
Rank 1
 answered on 09 Feb 2012
2 answers
135 views
Hi,

I have an issue about EditableImage. I'm trying to resize images but i get some exceptions like "Image stream seems to be causing issues" or "The source of the image seems to be invalid".

It doesn't throw exceptions always. Only some images couse the error. For example I attached two image. Org is the original image. And the other is edited image.

Org gives error. When i edit in photoshop and resize width to 750px it works.

My code is here :

protected void btnAddImage_Click(object sender, System.EventArgs e)
        {
            Stream StreamImage = flImage.PostedFile.InputStream;
            MemoryStream ms = new MemoryStream();
 
            byte[] imgData = new byte[StreamImage.Length];
            StreamImage.Read(imgData, 0, imgData.Length);
 
            ms.Write(imgData, 0, imgData.Length);
 
            SaveImage(ms, "g_" + PhotoID.ToString(), 610, 610);
        }
 
        void SaveImage(MemoryStream ms, string FileName, int Width, int Height)
        {
            try
            {
                EditableImage image = new EditableImage(ms);
                decimal oran = 0;
                Size s;
                if (!(Width > image.Width && Height > image.Height))
                {
                    if ((Width / Convert.ToDecimal(image.Width)) > (Height / Convert.ToDecimal(image.Height)))
                    {
                        //Height
                        oran = Height / Convert.ToDecimal(image.Height);
                        s = new Size(Convert.ToInt32(oran * image.Width), Convert.ToInt32(oran * image.Height));
                    }
                    else
                    {
                        //Width
                        oran = Width / Convert.ToDecimal(image.Width);
                        s = new Size(Convert.ToInt32(oran * image.Width), Convert.ToInt32(oran * image.Height));
                    }
                    image.Resize(s);
                }
 
                image.Image.Save(Server.MapPath(Settings["FolderPath"].ToString() + FileName + ".jpg"), System.Drawing.Imaging.ImageFormat.Jpeg);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Thanks for your help.
Erkan Şahan
Top achievements
Rank 1
 answered on 09 Feb 2012
2 answers
226 views
Hi,

I am using rad datepicker and i am clearing it if today or future date is selected and i am using it as below
Note: IT IS USED IN GRID'S EDIT FORM SETTING.

 function OnToDateSelected() {
                var HidCurrentDate = document.getElementById("ctl00_MainContent_hidCurrentDate");
                var CurrentDate = DateConversionForHidden(HidCurrentDate.value);

                var ServerIdRadioBtnlst = "rblOwnerTypeC";
                var tagNameRblbtnList = "input";
                var rblListC = GetGridServerElement(ServerIdRadioBtnlst, tagNameRblbtnList);//this will find the id of control used in grid in js

                var ServerIdRadioBtnlst = "rblOwnerTypeP";
                var tagNameRblbtnList = "input";
                var rblListP = GetGridServerElement(ServerIdRadioBtnlst, tagNameRblbtnList);
                if (rblListP.checked == true) {

                    var serverIDTo = "rdpPeriodTo";
                    var tagNameTo = "input";
                    var rdpPeriodTo = GetGridServerElement(serverIDTo, tagNameTo);
                    var ToDate = DateConversion(rdpPeriodTo.value);

                    if (ToDate >= CurrentDate) {
                        alert("you can't use current or future date in previous Owner");
                        rdpPeriodTo.clear();
                        return false;
                    }

                }
             
            }

<telerik:RadDatePicker ID="rdpPeriodTo" runat="server" Width="105px" Style="float: left;
                                            margin: 10px 0px 0px 0px;" ClientEvents-OnDateSelected="OnToDateSelected">
                                            <DateInput ID="DateInput2" runat="server" Font-Names="Georgia" >
                                            </DateInput>
                                            <Calendar ID="Calendar2" runat="server" ShowRowHeaders="false">
                                                <SpecialDays>
                                                    <telerik:RadCalendarDay Repeatable="Today" Date="">
                                                        <ItemStyle CssClass="rcToday" />
                                                    </telerik:RadCalendarDay>
                                                </SpecialDays>
                                            </Calendar>
                                        </telerik:RadDatePicker>

above functionality is showing javascirpt error "Error: rdpPeriodTo.clear is not a function". I think it is not working due to rad date picker used in Grid .... but i am getting the id of that rad date picker by using GetGridServerElement() method (provide by telerik). Please help me it is urgent.
Manish
Top achievements
Rank 2
 answered on 09 Feb 2012
3 answers
68 views
Hi,
We are using Telerik Rad Combobox in many pages of multiple applications. All pages were working fine till recently.

All of a sudden users are not able to filter data in Combobox by typing keywords. The filtering is not working properly and also results in the below error in almost all pages.

"Stop running this script? A Script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Yes / No" 

This happens in multiple applications hosted on multiple servers.
Any idea on how to troubleshoot this issue?

Our applications are running on .Net 2.0 and Telerik version is 2008.2.826.20

Thanks in advance,
Muhammed Saleem
Simon
Telerik team
 answered on 09 Feb 2012
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?