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

Hello,

In my site i am using Rad Grid,Rad Contex menu and  Rad popup features.
 
i am facing some problems :-
 1.    while i am inserting some through the Rad Popup , i am not being able to  rebining it.so newly inserted data are not showing in
        the Rad grid.Rad grid and Rad popup are  2 diiferent  Aspx page.
 2.    After inserting data through Rad popup  i want to close it automatically,How can i do this?

Thanks.
Denny

Georgi Tunev
Telerik team
 answered on 29 Jun 2009
5 answers
379 views

Hi, I have a button to programatically build the url for one RadWindow, but I have some strange problem showing the window, after the Window is closed, every control that must initiate an Ajax request forces a page reload on postback and the window apperas again.


This is my code on the page

    <script type="text/javascript">
   
    function OpenFreqWindow()
    {
        var mgr =  $find('RadWindowManager1'); // GetRadWindowManager();
//        alert(mgr);
        mgr.show();
        return false;
    }           
    function OpenWindow(url)
    {                     
        var mgr =  $find('RadWindowManager1'); // GetRadWindowManager();
        //alert(mgr);       
        var wnd = mgr.open(url, null);                              
        return false;
    }              
    </script>


this is the RadWindowManager

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista" Animation="None" Behavior="Default" Behaviors="Default" InitialBehavior="None" InitialBehaviors="None" Left="" Top="">
        <Windows>
            <telerik:RadWindow runat="server" Animation="None" Behavior="Default" Behaviors="Default"
                InitialBehavior="None" InitialBehaviors="None" Left="" NavigateUrl=""
                Skin="Vista" Style="display: none;" Top="" Modal="True" Width="500px" Height="500px">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

the code behind

    protected void btnShowWindow_Click(object sender, EventArgs e)
    {
            String url = "SomePage.aspx?source=fromWindow";
            GridItemCollection items = RadGrid1.Items;
            foreach (GridDataItem item in items)
            {
                TableCell cell = item["CheckBoxTemplateColumn"];
                CheckBox chkItem = cell.Controls[1] as CheckBox;
                if (chkItem.Checked)
                {
                    ++docCount;
                    url += "&doc"+docCount.ToString()+"=" + item["CustomerID"].Text;
                }
            }
            InjectScript.Text = "<script type='text/javascript'>Sys.Application.add_load(function(){OpenWindow('" + url + "')})</script>";
        }
    }

Can somebody help me with this issue? I've spent 2 days trying to figure out what's wrong

Any help would be appreciated

Thanks in advance
Georgi Tunev
Telerik team
 answered on 29 Jun 2009
1 answer
271 views

RadGrid

 

r = new RadGrid();

 

 

r.MasterTableView.DataKeyNames =

new string[] { "DepartmentID" };

 

 

 

r.Skin =

"Default";

 

 

 

r.Width =

Unit.Percentage(100);

 

 

 

r.PageSize = 5;

r.AllowPaging =

true;

 

 

 

r.AutoGenerateColumns =

 

 

false;

 

r.MasterTableView.PageSize = 15;

 

 

//Add columns

 

 

 

GridBoundColumn boundColumn;

 

boundColumn =

 

new GridBoundColumn();

 

boundColumn.DataField =

 

"DepartmentID";

 

boundColumn.HeaderText =

 

"DepartmentID";

 

r.MasterTableView.Columns.Add(boundColumn);

boundColumn =

 

new GridBoundColumn();

 

boundColumn.DataField =

 

"Budget";

 

boundColumn.HeaderText =

 

"Budget";

 

r.MasterTableView.Columns.Add(boundColumn);

 

 

 

 

 

//Detail table - Orders (II in hierarchy level)

 

 

 

GridTableView tableViewOrders = new GridTableView(r);

 

 

 

//tableViewOrders.DataSourceID = "AccessDataSource2";

 

 

tableViewOrders.DataKeyNames =

new string[] { "CourseID" };

 

 

 

GridRelationFields relationFields = new GridRelationFields();

 

relationFields.MasterKeyField =

 

"DepartmentID";

 

relationFields.DetailKeyField =

 

"DepartmentID";

 

tableViewOrders.ParentTableRelation.Add(relationFields);

RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders);

 

 

//Add columns

 

 

boundColumn =

new GridBoundColumn();

 

boundColumn.DataField =

 

"CourseID";

 

boundColumn.HeaderText =

 

"CourseID";

 

tableViewOrders.Columns.Add(boundColumn);

boundColumn =

 

new GridBoundColumn();

 

boundColumn.DataField =

 

"Title";

 

boundColumn.HeaderText =

 

"Title";

 

tableViewOrders.Columns.Add(boundColumn);

r.AllowMultiRowSelection =

 

true;

 

r.MasterTableView.DetailTables.Add(tableViewOrders);

r.DetailTableDataBind +=

 

new GridDetailTableDataBindEventHandler(r_DetailTableDataBind);

 

r.NeedDataSource +=

 

new GridNeedDataSourceEventHandler(r_NeedDataSource);

 

r.ID =

 

"RockOn";

 

 

 

this.PlaceHolder1.Controls.Add(r);

its the same code posted on Site Examples..


it loads ok but when i try to expand the grid Row ... i get an error--


Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.


on page load i m binding the DataSets to the Grid

 

 

Shinu
Top achievements
Rank 2
 answered on 29 Jun 2009
8 answers
834 views
I was wondering if there is a way to do a 2 column treeview? My treeview is simple, but I'm using two columns to save space. Only way I can think to do it is to deselect all nodes from the adjacent treeview each time a node is selected? Any ideas on the best way to implement something like this?

Great product by the way. Simply awesome. The skins, performance, everything, is the best around.

Thanks,
Levi
Naresh
Top achievements
Rank 1
 answered on 29 Jun 2009
1 answer
159 views
Hi all,
I have checkboxlist in rad grid ,I want to bind it from sqldatasource
I try with :

 

Value='<%#Eval("answer")%>'

 

but I get error !!???

thanks
ghadeer
Daniel
Telerik team
 answered on 29 Jun 2009
1 answer
209 views
How to set the Title for Edit Form Popup Template during edit and adding new record?

Regards,
Jones
Princy
Top achievements
Rank 2
 answered on 29 Jun 2009
0 answers
106 views

I have a custom HttpModule that filters out whitespace.  When it is enabled, the progress dialog does not appear.  I can't seem to figure out why.  Here is the code along with the change to web.config.  Please note that the whitespace code isn't even running on the upload.aspx page.  The line of code that causes the progress bar to fail seems to be:

if (app.Request["HTTP_X_MICROSOFTAJAX"] != null) { return; }

 

If I put a "return;" immediately above this line, the progress dialog appears.  If I put a "return;" immediately after this line, the progress dialog does NOT appear.  How does the executing the above line of code cause the progress dialog to fail to appear?

Thanks for any insight into this issue.  For now, I have to disable my whitespace httpmodule.

John

    <httpModules> 
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" /> 
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>  
      <add name="EntityTransactionModule" type="REO.Web.Data.EntityTransactionModule, REO.Web"/>  
      <add name="WhitespaceModule" type="WhitespaceModule"/>  
    </httpModules> 
 

 

 

 

 

 

 

 

#region Using  
 
using System;  
using System.IO;  
using System.Web;  
using System.IO.Compression;  
using System.Text.RegularExpressions;
#endregion  
 
/// <summary>  
/// Removes whitespace from the webpage.  
/// </summary>  
public class WhitespaceModule : IHttpModule  
{
    #region IHttpModule Members  
 
    void IHttpModule.Dispose()  
    {  
        // Nothing to dispose;   
    }  
 
    void IHttpModule.Init(HttpApplication context)  
    {  
        context.BeginRequest += new EventHandler(context_BeginRequest);  
    }
    #endregion  
 
    void context_BeginRequest(object sender, EventArgs e)  
    {  
        HttpApplication app = sender as HttpApplication;  
 
        if (app.Request["HTTP_X_MICROSOFTAJAX"] != null) { return; }  
 
        string rawurl = app.Request.Path.ToLower();  
        if (rawurl.EndsWith(".aspx") && !rawurl.ToLower().EndsWith("upload.aspx"))  
        {  
            app.Response.Filter = new WhitespaceFilter(app.Response.Filter);  
        }  
    }
    #region Stream filter  
 
    private class WhitespaceFilter : Stream  
    {  
 
        public WhitespaceFilter(Stream sink)  
        {  
            _sink = sink;  
        }  
 
        private Stream _sink;  
        private static Regex reg = new Regex(@"(?<=[^])\t{2,}|(?<=[>])\s{2,}(?=[<])|(?<=[>])\s{2,11}(?=[<])|(?=[\n])\s{2,}");
        #region Properites  
 
        public override bool CanRead  
        {  
            get { return true; }  
        }  
 
        public override bool CanSeek  
        {  
            get { return true; }  
        }  
 
        public override bool CanWrite  
        {  
            get { return true; }  
        }  
 
        public override void Flush()  
        {  
            _sink.Flush();  
        }  
 
        public override long Length  
        {  
            get { return 0; }  
        }  
 
        private long _position;  
        public override long Position  
        {  
            get { return _position; }  
            set { _position = value; }  
        }
        #endregion  
 
        #region Methods  
 
        public override int Read(byte[] buffer, int offset, int count)  
        {  
            return _sink.Read(buffer, offset, count);  
        }  
 
        public override long Seek(long offset, SeekOrigin origin)  
        {  
            return _sink.Seek(offset, origin);  
        }  
 
        public override void SetLength(long value)  
        {  
            _sink.SetLength(value);  
        }  
 
        public override void Close()  
        {  
            _sink.Close();  
        }  
 
        public override void Write(byte[] buffer, int offset, int count)  
        {  
            byte[] data = new byte[count];  
            Buffer.BlockCopy(buffer, offset, data, 0, count);  
            string html = System.Text.Encoding.Default.GetString(buffer);  
 
            if (!html.Contains("textarea"))  
            {  
                html = reg.Replace(html, string.Empty);  
            }  
 
            byte[] outdata = System.Text.Encoding.Default.GetBytes(html);  
            _sink.Write(outdata, 0, outdata.GetLength(0));  
        }
        #endregion  
 
    }
    #endregion  
}  
 

 

 

John
Top achievements
Rank 1
 asked on 28 Jun 2009
0 answers
102 views

Bottlerocket
Top achievements
Rank 1
 asked on 27 Jun 2009
3 answers
106 views
I'm in a very strange situation..

<

telerik:GridButtonColumn CommandName="Delete" UniqueName="Delete" Text="Delete" ButtonType="ImageButton"

 

 

ImageUrl="~/Image/Delete.gif" ConfirmDialogType= "RadWindow" ConfirmText="Are you sure you want to delete this ?"

 

 

ItemStyle-Width="20px" HeaderStyle-Width="20px">

 

 

<ItemStyle HorizontalAlign="Center"/>

 

 

</telerik:GridButtonColumn>

This confirm window is popup but when I click OK or Cancel no response..It's only happening on my production machine, Windows server 2003 sp2 and browser is IE7. The same configuration is on test machine. its working with out any issues. scripting is enabled on browser.
Any idea..it's very urgent ..

Thanks!

 

jo
Top achievements
Rank 1
 answered on 26 Jun 2009
1 answer
96 views

i have something like this

 

If

 

 

RadScriptManager1.IsInAsyncPostBack Then    

 

 

    Dim clicked_item As String = "Product"

 

    RadMenu1.FindItemByText(clicked_item).HighlightPath()

 

 

 

Else
     Dim clicked_item As String = "Product"

 

    RadMenu1.FindItemByText(clicked_item).HighlightPath()

end if

it will work fine if it is in the else statment but wont work when its in the if. Does this have to do with asyncpostback ? i think it is. so how do i solve this problem. thanks.

 

appdev
Top achievements
Rank 1
 answered on 26 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?