Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
260 views
I've attempted several methods of centering the loading panel on my page (has a fairly long RadGrid) and so far whnever I set the (issticky="true") my panel appears to be invisible or isn't being fired.

Actually with this current setup it is invisible on issticky true or false.


Here is my current implementation:

.CenteredLoadingPanel {  
        position: absolute;  
        left: 50%;  
        top: 50%;  
    }  

   
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" CssClass="CenteredLoadingPanel" IsSticky="true"> 
        <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="images/Loading.gif" /> 
    </telerik:RadAjaxLoadingPanel> 
      

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" > 


DogEars
Top achievements
Rank 2
 answered on 04 Mar 2008
7 answers
452 views
I'm running into an odd whack-a-mole type error. I have the following:
Master Page containing
    User control which itself contains a single RadPanelBar (a left nav menu)
Page with Master set to above and:
    Main content area has:
        5 standard DropDownLists
        2 standard TextBoxes
        1 standard Button control
        1 RadGrid
        
I have the ASP.NET AJAX Extensions installed and the AJAX Control Toolkit installed. I'm using 2007.2.1107 of the Prometheus controls.        
        
The problem occurs when I put a Prometheus RadWindowManager in the user control referenced in the left content area on the master page. In all cases, the problem only occurs on a postback. Initial load of the page in all cases works fine. I'm using Firebug to track down the error however I also get it in IE7.

With no asp:ScriptManager located anywhere, I obviously get the yellow screen of death and something to the effect that the ScriptManager is missing.

If I put the asp:ScriptManager in the Master page, initial load works fine, however clicking the button (i.e. firing a postback) gives me a "Telerik is not defined" javascript error.

If I put the asp:ScriptManager in the user control, I get a "Sys is not defined" error.

If I put the asp:ScriptManager in content area on the Page in question, I get "Telerik is not defined".

My preference obviously would be to put the ScriptManager on the master page.
Daniel Frumkin
Top achievements
Rank 1
 answered on 03 Mar 2008
1 answer
212 views
Ok, so I'll start off with what I'm having issues with and then paste code below.

I have a RadGrid that allows for grouping and sorting.  I have the RadGrid tied to a DataSet that is stored in ViewState.

I need to manually add columns in the code behind so that I can allow some to be hidden and also becasue we allow the users to add extra columns from the database.

After a lot of playing I thought I had it working, but now my problem is that when sorting the column headers go away.

The issue is, and I have no idea why it's designed this way, but on every single post back, the Column collection in the RadGrid keeps the column count and the number of columns there, but it clears all the properties on that column so that there is no header text, there is no DatatField property, there is DataType.

I just need to know why this does this and how I can get around it, it's been like 2 full days of frustration and trying to get those columns to be persistant across post backs.

RadGrid in aspx:
                        <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Office2007" Width="100%" BorderWidth="0px" 
                            GridLines="None" ShowGroupPanel="True" AllowSorting="True" OnNeedDataSource="RadGrid1_NeedDataSource" 
                            OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound" 
                            AllowMultiRowSelection="true" AutoGenerateColumns="true">  
                            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">  
                                <Selecting AllowRowSelect="True" /> 
                            </ClientSettings> 
                        </telerik:RadGrid> 
 

A lot of different RadGrid code in the codebehind:
        private DataSet dataSource  
        {  
            get { return (DataSet)ViewState["dataSource"]; }  
            set { ViewState["dataSource"] = value; }  
        }  
        public void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            RadGrid1.DataSource = dataSource;  
        }  
        protected void AddColumnsToRadGrid(string columnName, string columnText, Type dataType, bool display)  
        {  
            int test = 0;  
 
            GridBoundColumn newnewBoundColumn = new GridBoundColumn();  
            newBoundColumn.DataType = dataType;  
            newBoundColumn.DataField = columnName;  
            newBoundColumn.HeaderText = columnText;  
            newBoundColumn.Display = display;  
 
            if (_RadGrid1Columns == null)  
            {  
                _RadGrid1Columns = RadGrid1.Columns;  
                test = 1;  
            }  
 
            _RadGrid1Columns.Add(newBoundColumn);  
 
            if (test != 1)  
            {  
                RadGrid1.Columns.Clear();  
 
                foreach (GridColumn gc in _RadGrid1Columns)  
                    RadGrid1.Columns.Add(gc);  
            }  
        }  
        protected void AddColumnsToDataTable(DataTable table, List<JobAttributeValue> _javc)  
        {  
            System.Text.StringBuilder sb = new System.Text.StringBuilder();  
            sb.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");  
            sb.AppendLine("<ArrayOfJobTicket xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">");  
 
            int jrn = 0;  
            bool parseSuccess = false;  
            List<JobAttributeValue> matches = null;  
 
            foreach (DataRow row in table.Rows)  
            {  
                sb.AppendLine("<JobTicket>");  
 
                foreach (DataColumn column in table.Columns)  
                {  
                    sb.AppendLine(string.Format("<{0}>{1}</{2}>", column.ColumnName, row[column.ColumnName].ToString(), column.ColumnName));  
                    if (column.ColumnName == "JobRecordNumber")  
                    {  
                        parseSuccess = int.TryParse(row[column.ColumnName].ToString(), out jrn);  
 
                    }  
                }  
                if (parseSuccess)  
                {  
                    matches = _javc.FindAll(delegate(JobAttributeValue jav) { return jav.JobRecordNumber == jrn; });  
                    if (matches != null)  
                    {  
                        if(matches.Count == 1)  
                        {  
                            foreach (JobAttributeValue Attribute in matches)  
                                sb.AppendLine(string.Format("<{0}>{1}</{2}>", Attribute.AttributeName, Attribute.AttributeValue,Attribute.AttributeName));  
                        }  
                        else  
                            if(matches.Count > 1)  
                            {  
                                matches.Sort(delegate(JobAttributeValue obj1, JobAttributeValue obj2) {return obj1.AttributeValue.CompareTo(obj2.AttributeValue);} );  
                                foreach (JobAttributeValue Attribute in matches)  
                                {  
                                    if (matches.IndexOf(Attribute) == 0)  
                                        sb.AppendLine(string.Format("<{0}>{1}, ", Attribute.AttributeName, Attribute.AttributeValue));  
                                    else  
                                        if (matches.IndexOf(Attribute) == matches.Count - 1)  
                                            sb.Append(string.Format("{0}</{1}>", Attribute.AttributeValue, Attribute.AttributeName));  
                                        else  
                                            sb.Append(string.Format("{0}, ", Attribute.AttributeValue));  
                                }  
                            }  
                    }  
                }  
                else  
                {  
                    sb.AppendLine(string.Format("<{0}></{1}>", _javc[1].AttributeName, _javc[1].AttributeName));  
                }  
 
                sb.AppendLine("</JobTicket>");  
 
            }  
            sb.AppendLine("</ArrayOfJobTicket>");  
            //System.IO.File.WriteAllText("C:\\datasetoutfromSB.xml", sb.ToString());  
              
            TextReader tr = new StringReader(sb.ToString());  
            dataSource.Tables.Clear();  
            dataSource.ReadXml(tr, XmlReadMode.Auto);  
 
            AddColumnsToRadGrid(_javc[0].AttributeName, _javc[0].AttributeName, _javc[0].AttributeValue.GetType(), true);  
        }  
        protected void treeFolders_NodeClick1(object sender, RadTreeNodeEventArgs e)  
        {  
            //folderName = e.Node.Text;  
 
            //RadGrid1.CurrentPageIndex = 0;  
            //RadGrid1.Rebind();  
 
            //labelFrom.Text = String.Empty;  
            //labelDate.Text = String.Empty;  
            //labelSubject.Text = String.Empty;  
            //labelMessage.Text = String.Empty;  
 
            _currentSelectedNode = e.Node;  
 
            if (e.Node.Value != "")  
            {  
                string xmlValue = string.Empty;  
                if (e.Node != null)  
                    xmlValue = e.Node.Value.ToString();  
 
                if (xmlValue.Length > 0)  
                {  
                    JobTicketCollection JobTicketCollection = new JobTicketCollection();  
                    JobTicketCollection = JobTicketService.getJobsByFilter(xmlValue);  
                    if (JobTicketCollection != null)  
                    {  
                        if (JobTicketCollection.Count > 0)  
                        {  
                            Stream _stream = SerializationServices<JobTicketCollection>.SerializeToStream(JobTicketCollection);  
 
                            DataSet _dataSet = new DataSet();  
                            _dataSet.ReadXml(_stream, XmlReadMode.Auto);  
 
                            dataSource = _dataSet;  
 
                            // Add default columns to RadGrid  
                            AddColumnsToRadGrid("JobRecordNumber", "Job Record Number", typeof(Int32), true);  
                        }  
                    }  
                }  
                else  
                {  
                    DataSet _dataSet = new DataSet();  
                    dataSource = _dataSet;  
                }  
 
                RadGrid1.Rebind();  
            }  
        }  
        protected void btnStock_Click(object sender, EventArgs e)  
        {  
            List<int> jobRecNums = new List<int>();  
            foreach (DataRow dataRow in dataSource.Tables[0].Rows)  
                jobRecNums.Add(Convert.ToInt32(dataRow["JobRecordNumber"]));  
 
            List<JobAttributeValue> jobAttributeValueCollection = new List<JobAttributeValue>();  
            jobAttributeValueCollection = JobTicketService.getNewAttribute(jobRecNums, "ImprintLine_color");  
 
            AddColumnsToDataTable(dataSource.Tables[0], jobAttributeValueCollection);  
 
            RadGrid1.Rebind();  
        }  
 


Ok, so in explaination of what's going on in the code behind.
1. The dataSource DataSet is filled when you click on a treeNode.
2. The "JobRecordNumber" is added to the RadGrid Columns
3. When a user clicks the btnStock it goes out and adds a new column to dataSource and fills it with the different stocks.
4. Then it adds that column to the RadGrid.

This is my code, I'm just really wondering where I'm going wrong to make the columns in the RadGrid clear their properties on post back and also, if that's just how it is, how can I fix my code to work for me.

Thanks
Davey
David
Top achievements
Rank 1
 answered on 03 Mar 2008
2 answers
175 views
I am using the following RadAjaxManager code to control a RadDatePicker and a RadGrid.  I want the grid to update when either of those controls fires.  Changing the date in the date picker will load a new set of data in the grid.

It technically works, I guess, but not as well as I would expect when changing the date on the calendar.  When events fire on the grid, I can see the LoadingPanel during the duration of the update until the changes are processed.

When changing the date on the date picker, the loading panel only flashes on the grid and immediately disappears.  The update still takes another moment to occur.  (On the same note, the status bar of the grid also returns to "Ready" immediately even though the update is not complete.)

Is there something I have wrong in this declaration to cause this to happen?
Thanks,
Joel

<TELERIK:RadAjaxManager ID="AjaxManager" runat="server">
<AjaxSettings>
    <TELERIK:AjaxSetting AjaxControlID="rdtWorkDate">
        <UpdatedControls>
            <TELERIK:AjaxUpdatedControl ControlID="rgSchedule" LoadingPanelID="LoadingPanel" />
        </UpdatedControls>
    </TELERIK:AjaxSetting>
    <TELERIK:AjaxSetting AjaxControlID="rgSchedule">
        <UpdatedControls>
            <TELERIK:AjaxUpdatedControl ControlID="rgSchedule" LoadingPanelID="LoadingPanel" />
        </UpdatedControls>
    </TELERIK:AjaxSetting>
</AjaxSettings>
</TELERIK:RadAjaxManager>
<TELERIK:RadAjaxLoadingPanel runat="server" ID="LoadingPanel" Transparency="30" BackColor="#E0E0E0">
<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0" />
</TELERIK:RadAjaxLoadingPanel>
Joel Kraft
Top achievements
Rank 2
 answered on 03 Mar 2008
3 answers
183 views
I am getting the above when trying to cast a datarow returned in a nodedatabound events' radtreenodeeventargs to a strongly typed datarow derived from the strongly typed datatable that the treeview was originally bound to.

To reproduce, just create a strongly typed dataset with one table, add a prometheus treeview to a page with an object datasource bound to the control that derives from the table you added to the dataset, then hook up the nodedatabound event for the control.

If you then create a datarow and try to cast it back to your strongly typed object it fails.

eg

protected
void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
{
DataRow datarow = ((DataRowView)e.Node.DataItem).Row;
MyDataset.MyDataRow myrow = (MyDataset.MyDataRow)datarow; 

Can someone please help me with this.

Darren
Atanas Korchev
Telerik team
 answered on 03 Mar 2008
4 answers
152 views
I have some pages with a masterpage and 1-3 radGrids and all is ajaxified. I want to be able to navigate from and to these pages with the grid information intact.
Has anyone implemented this functionality successfully in asp .net 2.0-3.0? And if so, how?

Regards, Magnus
mgns
Top achievements
Rank 1
 answered on 03 Mar 2008
1 answer
120 views
hi
in privuse version of radsplitter I set pane content url but that code dosn't work in new version. my code is like this:
1-    var splitter = <%= radsplitter1.ClientID%>;
2-    var pane = splitter.GetPaneById(<%= pane1.ClientID%>);
3-    if (pane == null)
4-        return
5-    pane.SetContentUrl('www.test.com');

when I run this javascript code it alert that object dosn't this property
error is in line 5
is there any one familier with this?
George
Telerik team
 answered on 03 Mar 2008
4 answers
165 views
I have some preliminary questions for using Scheduler.

1. I do not want to keep the ViewState for the Scheduler. So, in Page_PreRender I bind the Scheduler with appointments ( a custom class object list) everytime. I only set the RadScheduler1.DataSource and then call RadScheduler1.Rebind(). -- is this okay?

2. When the page loads first time it displays the results correctly (calls AppointmentCreated event too). But then when I change the date, it again fetches appointment for next date - there are appts for that date too - but then AppointmentCreated does not get called and the Scheduler is displayed empty. How can I make sure that Scheduler gets refreshed on every Page_PreRender or any other event like that.

3. The other thing is - I use RadTooltip in Scheduler. When OnAjax_Update() gets called, the .net calls PreRender again and it again binds the RadScheduler. I understand that I can't avoid it - so other approach would be to update RadScheduler in different events but not in PagePreRender. If I do that, then since I am not using ViewState, and call is made for Tooltip - will there be any problem? Or do you suggest any alternative for Tooltip - like calling PageMethods through Ajax to get the content to display in tooltip control and not go through whole page event cycle.

-Piyush



Dimitar Milushev
Telerik team
 answered on 03 Mar 2008
1 answer
234 views
I there is a double click client event and I am using it but I was wondering if there is anyway to have the event postback to a server side event also.  Essentially creating a double-click server-side event?
Atanas Korchev
Telerik team
 answered on 03 Mar 2008
2 answers
142 views

I need to implement a Scheduler which only the administrator users can insert, update and delete the event of the RadScheduler. Please tell me how to disable the delete event. Thank you very much.

Vinix
Top achievements
Rank 1
 answered on 03 Mar 2008
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?