Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
274 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
144 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
73 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
715 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
88 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
166 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
231 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
85 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
159 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
1 answer
93 views
Hi

I'm using a RadGrid with a Popup Edit Form.
The RadGrid is using AJAX.

When I click the cancel button in the Popup Edit From, the RadGrid does a AJAX refresh that takes about a second to complete.
The problem is that the Popup Edit Form does not close until the AJAX update, of the RadGrid, is complete.

I want the Popup windows close directly when I click the cancel button or the X (in the upper right corner of the popup) and then the RadGrid can refresh (only on insert or update).
Is this possible?

Why does the Radgrid tries to update itself when I click cancel (there no need for a refresh) ?

Regards
Per
Martin
Telerik team
 answered on 25 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?