Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
69 views
Hi All,

I have an issue where if I use the MediaManager to link in a wmv file to the RadEditor it hangs IE6 on the following Reponse.Redirect.

On the Button_Click event I am calling a method to save to the database.
<asp:Button runat="server" ID="SubmitButton" Text="Submit For Approval" CausesValidation="true" OnClick="SubmitButton_Click" OnClientClick="javascript:window.scrollTo(0,0);" />

Which calls the method in the code behind.
    Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SubmitButton.Click
        CreateNewArticle()
    End Sub

    Private Sub CreateNewArticle()

        Dim newArtID As Int32 = 0
        Dim body As String = String.Empty
        Dim art As Article = Nothing
        Dim artBody As ArticleDetail = Nothing

        Try
            'create the new article
            art = Article.CreateArticle(-1,
                                        articletitle.Text,
                                        articlesummary.Text,
                                        False,
                                        Date.Now,
                                        System.Web.HttpContext.Current.User.Identity.Name.Remove(0, InStr(System.Web.HttpContext.Current.User.Identity.Name, "\")).Replace(".", " ").ToUpper,
                                        GetVisibiliy)
            art.UpdatedDate = Date.Now

            If articlebody.Content.Contains("<img") Then
                art.ThumbnailImage = Mid(articlebody.Content, InStr(articlebody.Content, "src=") + 5, InStr(InStr(articlebody.Content, "src=") + 5, articlebody.Content, "/>") - (InStr(articlebody.Content, "src=") + 5)).Replace(Chr(34), "").TrimEnd
            Else
                art.ThumbnailImage = "~/Content/Images/JCBLogo.png"
            End If

            'create the article detail
            artBody = ArticleDetail.CreateArticleDetail(-1, -1, articlebody.Content.Replace("&nbsp;", " "))

            'save to the db
            Using insertContext As New JCB_IntranetEntities
                insertContext.AddToArticles(art)
                insertContext.AddToArticleDetails(artBody)
                insertContext.SaveChanges()
            End Using

            newArtID = art.ArticleID

        Catch ex As Exception
            ErrorLogging.AddNewErrorLogEvent(ex)
            Throw
        Finally
            If articlebody.Content IsNot Nothing Then
                articlebody.Content = Nothing
                articlebody.Dispose()
            End If
            If artBody IsNot Nothing Then artBody = Nothing
            If art IsNot Nothing Then art = Nothing
        End Try

        'If the save worked then redirect to the article
        If newArtID > 0 Then
            Response.Redirect(String.Format("~/Articles/Article.aspx?ArticleID={0}", newArtID))
        End If

    End Sub
The data saves correctly but hangs on the Response.Redirect at the bottom of the method. I have checked the Page Load in the called page and the code runs through as expected. I did check to see if it was a problem with the target page by changing the redirect to www.google.com and experienced the same behaviour.

This only seems to happen if I embed a video into the editor, if I use just text & images the save and redirect works without issue. I have also confirmed that it works in Firefox & IE7/8.

Any thoughts you have would be welcome.

Regards

Phil Murray
Rumen
Telerik team
 answered on 25 Oct 2010
2 answers
327 views
Dear all

I have a RadGrid contains 3 columns as below:
 
<telerik:GridBoundColumn DataField="ID" HeaderText="ID" 
    ReadOnly="True" UniqueName="column1">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Seller" HeaderText="Seller" 
    ReadOnly="True" UniqueName="column2">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Amount" HeaderText="Amount" 
    UniqueName="column3">
</telerik:GridBoundColumn>

2 of them are read only and user can only edit in column3.

I get the edited item as below:

But I can't get the value of the first column , the "ID" ?!!!!

protected void grdSellers_ItemCommand(object source, GridCommandEventArgs e)
{
    switch (e.CommandName)
    {
        case "Update":
            GridEditableItem editedItem = e.Item as GridEditableItem;
            TableCell cell = editedItem["column3"];  
            string itemValue = (cell.Controls[0] as TextBox).Text;
              
            //Get Id of editable item ??
    }
}


I tried the solution in this post:
http://www.telerik.com/community/forums/aspnet-ajax/grid/accessing-readonly-hidden-fields-in-edit-mode-radgrid.aspx

but it generate error about ParentItem !

Could any one help me in that issue ??

Regards
Noha
Top achievements
Rank 1
 answered on 25 Oct 2010
1 answer
190 views
Hello,

I want to change the column order in code (in Page_Load).

i write this code:
    
    GridColumn gc1 = MyGrid.Columns.FindByDataField("ID");
    GridColumn gc2 = MyGrid.Columns.FindByDataField("NAME");
    MyGrid.Columns.Remove(gc1);
    MyGrid.Columns.Remove(gc2);
    MyGrid.Columns.AddAt(0,gc2);
    MyGrid.Columns.AddAt(0,gc1);

with this code i took "ID" column and "NAME" column and put them right in the start.
When the page is loaded in the first time, everything look good, the "ID" is at the start and the "Name" is right after.
when i click on the grid or make any postback to the server i get this error:

"Sys.WebForms.PageRequestManagerServerException: Failed to load viewstate. the control tree into which viewsate being loaded must match the control tree that was used to save viewstate during the previous request. for example, when adding controls dynamically the controls added during a post back must match the type and position of the control added during the initial request

Can you please help me with changed index spot during page_load event?
I have no idea what to do with this error.


Yael.
Princy
Top achievements
Rank 2
 answered on 25 Oct 2010
1 answer
104 views
Hello,

I am unable to upload a 75 mb file using your demo.

After around 20MB is uploaded i get the message,"the server cannot find the web page"!

Please let me know what's the problem?

Thank you

Regards
Raj

Princy
Top achievements
Rank 2
 answered on 25 Oct 2010
7 answers
832 views

I have quite a complex set of classes which parses an XML file or RSS feeds.

I know that radgrid can bind to an arraylist, so I have this code:

  protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{

ArrayList arraylist = new ArrayList();


if (dict != null)
{
foreach (var v in dict)
{




arraylist.Add(new RSSFeedItem(v.Date, v.Description, v.Title, v.Title));
RadGrid1.DataSource = arraylist;


}
}
}

"dict" is a collection of articles in an RSS feed. So for every article inside, I add that article's date, link, description, etc to the array list, and then set the datasource to that arraylist.

On the last line of the code, I check the grid's state and it is containing the items (e.g. first pass in the loop, there is a count of 1, etc). Datasource has a count of 25 which contains the articles.

Also, how can I get the row count programatically?

Thanks

Princy
Top achievements
Rank 2
 answered on 25 Oct 2010
3 answers
114 views
Is it possible to use RadEditor as text editor? I want to use the toolbar capabilities for injecting content but I need the editor to produce text instead of HTML and maintain new lines etc.
Rumen
Telerik team
 answered on 25 Oct 2010
1 answer
215 views
Hi All:
Here is my problem.
I need to change the selected item in a panel bar at run time.
I am using the following code to achieve this.. (hapenning on ajax request)
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
      If hdnMenu.Value = "6" Then
          If (e.Argument.StartsWith("ListesGroupes")) Then
              If e.Argument.ToString.Split("$")(1) = "1" Then
                 //do something
              Else
                 // reset the panel bar
                  RadPanelBar1.ClearSelectedItems()
                  Dim myItem As RadPanelItem = DirectCast(RadPanelBar1.FindItemByText("Mes alertes"), RadPanelItem)
                  myItem.Selected = True
                  myItem.ExpandParentItems()
              End If
          End If
      Else
  End Sub

However, the selected is not changing. My page consist of 2 content place holders with a master. I am not using a radajaxmanager in my master/ proxy in child in this case as the application was already built when I took over and am just doing support.

So this page contains
1. Content place holder 1
a. this contains the PanelBar which is named RadPanelBar1
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadPanelBar runat="server" ID="RadPanelBar1"
        Width="100%" Height="100%"  PersistStateInCookie="false"  OnClientItemClicking="OnClientItemClicking" EnableEmbeddedSkins="false" Skin="IroiseSkin">
        <Items>
            <telerik:RadPanelItem Text="Agendas"  Value="AGENDA"  Expanded="true"   PreventCollapse="true">
                <Items>
                        <telerik:RadPanelItem ImageUrl="../Images/flyout_arrow.gif" Text="Mes RDV" NavigateUrl="" PostBack="false" Value = "AGENDA.RDV"   Selected="true" />
                        <telerik:RadPanelItem ImageUrl="../Images/flyout_arrow.gif" Text="Mes mémos"  NavigateUrl="" PostBack="false" Value = "AGENDA.MEMO" />
                        <telerik:RadPanelItem ImageUrl="../Images/flyout_arrow.gif" Text="Mes tâches" NavigateUrl="" PostBack="false" Value = "AGENDA.TACHE"  />
                        <telerik:RadPanelItem ImageUrl="../Images/flyout_arrow.gif" Text="Mes alertes" NavigateUrl="" PostBack="false" Value = "AGENDA.ALERT" />
                        <telerik:RadPanelItem ImageUrl="../Images/flyout_arrow.gif" Text="Tout l'agenda" NavigateUrl="" PostBack="false" Value = "AGENDA.TOUT"    />
                        <telerik:RadPanelItem ImageUrl="../Images/flyout_arrow.gif" Text="Agendas groupes" NavigateUrl="" PostBack="false" Value = "AGENDA.GROUPE" />
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
</asp:Content>



2. Content place holder 2
a. contains the RadAjaxManager + lots of things (radscheduler + radwindows)

I have been checking till when the changes I make  to the PanelBar, in the above function, remain active and I see that before the RadPanelBar1_PreRender function the changes are still there but after the functions for applything the theme takes over and I lose my changes.

My idea is that I am doing something wrong in the ajax manager but I am not sure what.
Please help me in finding the solution to this error.

Thank you!
Shinu
Top achievements
Rank 2
 answered on 25 Oct 2010
1 answer
277 views

Hi,

i am exporting my radgrid to msword.
how to set the font size and font family while exporting data in ms word.

please reply.
Shinu
Top achievements
Rank 2
 answered on 25 Oct 2010
1 answer
103 views
I m  using this code,but below error is coming....I m using visual web developer2008....Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 ...ajax toolkit not used

'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager



<system.webServer>
            <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true">
      <remove name="ScriptModule"/>
      <add name="n2.initializer" type="N2.Web.InitializerModule, N2"/>
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>

      <add name="RadCompression" type="Telerik.Web.UI.RadCompression"
           
    </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>
      <add name="n2.ajax" path="*.n2.ashx" verb="*" type="N2.Web.AjaxRequestHandler, N2"/>
           
      
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" EnableHandlerDetection="false" preCondition="integratedMode,runtimeVersionv2.0 "/>
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
    </handlers>
    
    <staticContent>
      <remove fleExtension=".vcs" />
      <remove fileExtension=".vcf" />
      <mimeMap fileExtension=".vcf" mimeType="text/x-vcard" />
      <mimeMap fileExtension=".vcs" mimeType="text/x-vCalendar" />
    </staticContent>
    
  </system.webServer>





shal u plz help me
Yana
Telerik team
 answered on 25 Oct 2010
1 answer
194 views
In my form I have a RadGrid control and the data source is LinqDataSource which is connected to Entity Framework Model.

Everything works fine except when I am trying to do filtering on columns. For example when I try to apply contains filter on a string column I am getting this error:

LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.


We are using DataSourceID property in the grid for data binding.

I tried EntityDataSource as datasource and filtering works fine, but we have to use LinqDataSource in our specific case.

Any ideas why it happens?

Maria Ilieva
Telerik team
 answered on 25 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?