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

I need assistance i'm trying to export from a radgrid but also i need to make an update after export, but seems that doesnt work no matter where i put the update radgrid exports the same query with no results on it.

let me give you more details i have a table and one column is exported wich can have 2 values "0" for not exported and "1" for items exported.

on my web page i can filter for date (start and end date) and i can include exported items, wich gives me 8 possible combinations. No matter wich select i use i want to export to excel items on grid using a button and also want to update items to make column exported value from 0 to 1

do you have any idea why i cant do this?

here is my button code.

protected void BTN_Exportar_SAP_Click(object sender, EventArgs e)
    {
        Lerror.Text = "";
        RadGrid2.ExportSettings.FileName = "Proveedores(Formato SAP)";
        RadGrid2.ExportSettings.ExportOnlyData = true;
        RadGrid2.ExportSettings.IgnorePaging = false;
        RadGrid2.ExportSettings.OpenInNewWindow = true;
        SqlDataSource1.SelectCommand = Session["Query"].ToString();
        RadGrid2.Visible = true;       
        RadGrid2.Rebind();
        RadGrid2.MasterTableView.ExportToExcel();
        Session["DoUpdate"] = "1";
        SqlDataSource1.UpdateCommand = Session["Update"].ToString();
        SqlDataSource1.Update();
}

thanks in advanced.
Yavor
Telerik team
 answered on 25 Sep 2008
3 answers
113 views
Hi there

I'm looking for some help. I have a RadGrid which has a NestedViewTemplate for each of the bound rows. On clicking the expand button, I make a call to a web service and teh data from this populates the nested table. This works as expected, revealing a databound table.

When I click on the collapse button for a particular expanded row, the page does a post back. I am looking to not do this on the collapse click, the row should just close.

Do you know of any way I can accomplish this? Is there an onclick event I can attach to the expand/collapse button that will 'hide' the nested table for the same row. Is this something I can do on ItemCommand or ItemDataBound events?

Thanks in advance

GD
Nikolay Rusev
Telerik team
 answered on 25 Sep 2008
2 answers
215 views

Hi,

I got this error:

Micorosfot JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. the status code returned from the server was:12030

I have a RadTreeView in a RadPanelBar in aspx file
                                    <rad:RadPanelItem Text="Property" ImageUrl="Img/mail.gif" Expanded="False" Width="100%" >
                                        <Items>
                                            <rad:RadPanelItem>
                                                <ItemTemplate>
                                                    <telerik:RadTreeView ID="tree_bound" runat="server" TabIndex="1" Visible="true" OnNodeClick="RadTreeView1_NodeClick" OnClientNodeClicked="tree_bound_OnClientNodeClicked" ForeColor="Blue" >
                                                        <WebServiceSettings Path="Bound.asmx" Method="GetTreeViewBound" />
                                                        <Nodes>
                                                            <telerik:RadTreeNode Text="Hong Kong SAR" Value="A375CD32-1EEB-44AB-B7FF-202C267AA095" ExpandMode="WebService" ForeColor="Blue">
                                                            </telerik:RadTreeNode>
                                                           
                                                            <telerik:RadTreeNode Text="Macau" Value="F1FD132C-5227-4E18-A698-EAE4C10A099D" ExpandMode="WebService" ForeColor="Blue">
                                                            </telerik:RadTreeNode>                                                   
                                                        </Nodes>                                               
                                                    </telerik:RadTreeView>                                               
                                                </ItemTemplate>
                                            </rad:RadPanelItem>
                                        </Items>
                                    </rad:RadPanelItem>


in cs file:
    private void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        if (dataSource != null)
        {
            if (current_bound_id == previous_bound_id)
            {
                RadGrid1.DataSource = dataSource;
            }
            else
            {
                Property p = new Property();
                dataSource = p.GetPropertyByBoundId(current_bound_id);

                Session["itemsCount"] = dataSource.Rows.Count;

                RadGrid1.DataSource = dataSource;
            }           
        }
        else
        {
            labelMessage.Text = "<div style='color:red;'>Your session has expired. Please reload the page.</div>";
        }
    }

    protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        this.previous_bound_id = this.current_bound_id;
        this.current_bound_id = e.Node.Value;
        this.RadGrid1.DataSource = null;
        this.RadGrid1.Rebind();       
    }



OnceI clicked a large record item in the tree, the grid can bind the data but will generate the above error after click another items, is it related to the cache or ISA Proxy problems?

Please help.

Paul
Top achievements
Rank 1
 answered on 25 Sep 2008
3 answers
151 views
 I want to create number of rad grids on a user control. This number is driven from DB.
As a sample I created a single Grid on ASPX page,
after reading all the related threads and help for dynamic creation.

Every thing works fine, including the sorting.
But when Sorting and Paging both are enabled then, we have issue.
It seems that the grid is sorted on last and first page click.

Below is the code.

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.WebControls;
using ClickTactics.Data.ObjectMapping;
using System.Data;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
  //if (!IsPostBack)
  //{
  //    DefineGridStructure();
  //}
    }

 protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
 {

  //if you allow the id of the header buttons to be autgenerated
  //for some reason they change on postback after sorting which then
  //fires an error after the 2nd attempt to sort...this is a workaround
  if (e.Item is GridHeaderItem)
  {
   foreach (TableCell cell in e.Item.Cells)
   {
    foreach (Control ctrl in cell.Controls)
    {
     if (ctrl is LinkButton)
     {
      ctrl.ID = "btn" + (ctrl as LinkButton).ClientID;

     }
    }
   }
  }
 }

 

 protected void Page_Init(object sender, System.EventArgs e)
 {
  DefineGridStructure();
 }
 private void DefineGridStructure()
 {
  
  RadGrid grid = new RadGrid();
  grid.ItemCreated += new GridItemEventHandler(RadGrid1_ItemCreated);
  grid.NeedDataSource += new GridNeedDataSourceEventHandler(grid_NeedDataSource);

 

  grid.ID = "RadGrid1";// +DateTime.Now.ToString();
  grid.MasterTableView.ID = "RadGrid1MTView";
  
  grid.Skin = "Inox";
  grid.Width = Unit.Percentage(100);
  grid.PageSize = 1;
  grid.AllowPaging = true;
  grid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
  grid.AutoGenerateColumns = false;
  grid.AllowSorting = true;
  

  //Add Customers table
  grid.MasterTableView.PageSize = 2;
  grid.MasterTableView.Width = Unit.Percentage(100);
  grid.MasterTableView.DataKeyNames = new string[] { "EmpID" };
  GridBoundColumn boundColumn = new GridBoundColumn();
  
  boundColumn.DataField = "EmpID";
  boundColumn.HeaderText = "Emp ID";
  grid.MasterTableView.Columns.Add(boundColumn);
  boundColumn = new GridBoundColumn();
  boundColumn.DataField = "EmpName";
  boundColumn.HeaderText = "EmpName";
  grid.MasterTableView.Columns.Add(boundColumn);

 

 

  grid.DataSource = GetDataTable();

  grid.DataBind();
  //Add Orders table
  

  // Add the grid to the placeholder
  this.PlaceHolder1.Controls.Add(grid);
 }

  
 }


Sebastian
Telerik team
 answered on 25 Sep 2008
3 answers
130 views
Whe are migrating to the new "prometheus" ajax manager.
In the old Ajaxmanager we could update controls without knowing which control caused a postback through the ResolveUpdatedControls event.

I've read the documentation and I know the event is removed in the new version.

What I'm trying to accomplish is that I can update parts of the Page without knowing wich control caused the postback. Some parts always need an async refresh and some parts refresh only if the logic of the page decides they have to do so.

This code shows how we are now handling updates in a very flexible way through the ResolveUpdatedControls event. We only had to make sure the control that causes a postback was ajaxified.
        private void RadAjaxManager1_ResolveUpdatedControls(object sender, UpdatedControlsEventArgs e)  
        {  
              
              
            foreach (Control ctl in GUIManagement.ResolveUpdateControls)  
            {  
                e.UpdatedControls.Add(new AjaxUpdatedControl(ctl.UniqueID,String.Empty));  
            }  
 
            Control _postbackcontrol = Page.FindControl(e.PostBackControlID);  
            if (_postbackcontrol == null)  
            {  
                e.SuppressError = true;  
            }  
 
            GUIManagement.ResolveUpdateControls = new List<Control>();  
 
        } 

I've read the other thread about this problem.
(http://www.telerik.com/community/forums/thread/b311D-bcdtdd.aspx)
It feels wrong to add all posible AjaxSettings for every control that might have to be updated and cancel them all afterwards, accept for the correct ones.

Is there already a better solution for this problem?

Thanks in advance.
W Klijnsmit
Top achievements
Rank 1
 answered on 25 Sep 2008
4 answers
151 views
Hello

I have upgraded from classic PanelBar to PanelBar for asp.net ajax. My panelbar is populated server side and seems to be served as proper html with all correct css classes, but in IE7 the PanelBar is first rendered as a simple un-styled html list, and then quickly  (<1 second) re-rendered with correct style (I have tried Vista, Black etc). In firefox this does not happen.

The panelbar is very simple, no postbacks, no ajax, just items with links and default collapse/expand behavior.

I suspect the "new" asp.net ajax style init code that looks like this:

Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadPanelBar,.... etc
Sys.Application.initialize();

What can I do to get the "old" quick no-nonsense behavior back?
Christian Jensen
Top achievements
Rank 1
 answered on 25 Sep 2008
3 answers
156 views
Hi,

I need to bind a grid with more than one column to an ArrayList. The problem is,
that an ArrayList can store only "single" objects. Do I have to create a ArrayList for
every colum in the grid or is there some other collection which is more suitable for this scenario?

Best regards,
Robert 
Vlad
Telerik team
 answered on 25 Sep 2008
1 answer
215 views
Hi,
I am using RadGrid, and in RadGrid row i have DropDownList, Now on select index changed event i want to open a Radwindow Pop. I tried with java script but i could not find the code to call JavaScript in code behind. So could please suggest any appoarch how to Open Rad window Pop in select changed event of DropDown.
Please help me...


Thanks and regard,
Sagar
Georgi Tunev
Telerik team
 answered on 25 Sep 2008
1 answer
182 views
We developer a pretty cool calendar using RADScheduler but all componenets like adding new events are running very slow.  Does anyone have this issue with the scheduler or does anyone know of things we might look at the addresses the spedd issues?  Thanks!
Princy
Top achievements
Rank 2
 answered on 25 Sep 2008
1 answer
245 views
Hello,

I am using the radgrid (with embeded user control for insert/updates) and am getting the below error.  I looked at prior threads on this and didn't get much info.  I am using iis for dev.  The viewstate is rather long -- just like the other person who had this issue.  Does your product have a solution for this?

Thanks,
John




The state information is invalid for this page and might be corrupted.

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.Web.HttpException: The state information is invalid for this page and might be corrupted.

Source Error:

[No relevant source lines]

Source File: c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gts\66465252\6412235f\App_Web_19unemgx.0.cs    Line: 0

Stack Trace:

[ViewStateException: Invalid viewstate. 
	Client IP: 127.0.0.1
	Port: 
	User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; OfficeLiveConnector.1.0)
	ViewState: /wEWGQKqldKtAgLgnJ+tCwKw5JmFBQKy1dPWCgKy1c/WCgKy1dvWCgKy1dfWCgKy1efWCgKy1bPWCgKy1a/WCgKz1dPWCgKy1efMDALepqeKCQKI09jPDALjpr/IBQKI0/DJDALgpreGBgKI0+jLDAK2r5keAqfTyNQMAoOXmtoKAovux5MGApuB7f0KAoSB7f0KAovux5MG0P3G4Qv4hMvLkgWRO1x4loOs0oQ=
	Referer: http://localhost:3531/GTS/admin/GrantNumber.aspx
	Path: /GTS/admin/GrantNumber.aspx]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +267
   System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +2133067
   System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +66
   System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +108
   System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection) +55
   System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +11
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +353
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
   System.Web.UI.Page.ProcessRequest() +86
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.admin_grantnumber_aspx.ProcessRequest(HttpContext context) in c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gts\66465252\6412235f\App_Web_19unemgx.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Vlad
Telerik team
 answered on 25 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?