Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
221 views
I am having a problem with accessing the treeview in javascript during the page load.  I need to do some work before my page finishes loading but it seems as though the treeview is one of the last things initialized on the page, thus I am not able to access it in JS.

I am doing the following:

ScriptManager.RegisterStartupScript(this.Page, typeof (string),"start",  
                                                string.Format(  
                                                    "mainTree = $find('{0}');window.ChangeDataContents(mainTree.get_selectedNode());",  
                                                    this.RadTreeView1.ClientID), true); 


But the html output shows this:

<script type="text/javascript">  
//<![CDATA[
mainTree = $find('ctl00_cph2_RadTreeView1');window.ChangeDataContents(mainTree.get_selectedNode());//]]> 
</script> 
<script type="text/javascript">  
//<![CDATA[  
Telerik.Web.UI.RadTreeView._preInitialize("ctl00_cph2_RadTreeView1","0");  
theFormtheForm.oldSubmit = theForm.submit;  
theForm.submit = WebForm_SaveScrollPositionSubmit; 

As you can see the treeview is not getting initialized until after I am trying to call it.  Is there a way around this?  Is there a way to give us a method that is called after the preinitalize so we can add our own code to? 

Jason
Jason Maronge
Top achievements
Rank 1
 answered on 01 Feb 2008
2 answers
170 views
When my page loads I don't have any nodes loaded on a radtreeview control. I want to load them from client-side script during the page load. Meanwhile the tree is loading, I want to display an ajax loading panel. How can I do that? Thanks!
relper
Top achievements
Rank 1
 answered on 01 Feb 2008
2 answers
361 views
I have a grid with a GridClientSelectColumn column like so:

 <telerik:RadGrid ID="Foo" runat="server"  
                    Width="275px" Height="400px"  
                    AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"  
                    AllowMultiRowSelection="true"  
                    AutoGenerateColumns="false" ShowHeader="true" ShowFooter="false" 
                    OnPreRender="Foo_PreRender" > 
                    <MasterTableView DataKeyNames="Key" ShowHeadersWhenNoRecords="true" TableLayout="fixed"> 
                        <Columns> 
                            <telerik:GridClientSelectColumn> 
                                <ItemStyle Width="30px" /> 
                                <HeaderStyle Width="30px" /> 
                            </telerik:GridClientSelectColumn> 
                            <telerik:GridBoundColumn DataField="Description" HeaderText="Display Choice" UniqueName="Description"> 
                                <ItemStyle Width="220px" /> 
                                <HeaderStyle Width="220px" /> 
                            </telerik:GridBoundColumn> 
                        </Columns> 
                    </MasterTableView> 
                    <ClientSettings ApplyStylesOnClient="true" > 
                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true"  /> 
                        <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="300px" /> 
                    </ClientSettings> 
                </telerik:RadGrid> 

This grid is on a UserControl which is on a Page with a Master Page set and the UserControl is loaded at runtime. When the user navigates to the page, they can use the various built-in selection techniques to select multiple items and then hit a button which stores the selections into session. All that works peachy.

The problem comes when they navigate back to this page with the grid and I try to selected the items they previously selected. I have tried setting the selected items from the Page_Load and from the grid's PreRender like so:

 foreach ( MyCustomDisplayItem displayItem in this.CurrentSelections ) 
            { 
                foreach ( GridItem item in this.Foo.MasterTableView.Items ) 
                { 
                    GridDataItem dataItem = item as GridDataItem; 
                    if ( dataItem == null ) 
                        continue; 
 
                    string key = dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["Key"].ToString(); 
                    if ( string.CompareOrdinal( key, displayItem.Key ) != 0 ) 
                        continue; 
 
                    dataItem.Selected = true; 
                    break; 
                } 
            } 

In this case, "this.CurrentSelections" is a collection of MyCustomDisplayItem objects. When the page renders on a return navigation, the checkboxes on the GridClientSelectColumn are in fact checked. However, if the user checks a few unchecked items and then posts the results, the codebehind only sees the new checked items.

For example, suppose there are 10 items in the list and on the first pass, the user selects five of them. They post the results and then come back whereby they select two more items. When they post the second time, the SelectedItems property only contains the two items they checked. It does not see the original five. In addition, while the GridClientSelectColumn is checked for the items where I set Selected to true, the row is does not appear selected as it would if the the user were to select it.

My goal is simple: I want to populate the grid on return such that it looks exactly as it did when they first selected items.




Thomas
Top achievements
Rank 1
 answered on 01 Feb 2008
1 answer
179 views

I've got this drop down column in a bound grid.

<telerik:GridDropDownColumn DropDownControlType="DropDownList" CurrentFilterFunction="NoFilter" DataField="RoleId" DataSourceID="RoleDataSource1" EnableEmptyListItem="True" FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Role" ListTextField="Name" ListValueField="Id" SortExpression="Name" UniqueName="column1"> 
</telerik:GridDropDownColumn> 

When DropDownControlType="DropDownList" and the field value is null, the value is properly shown as empty in the column.

But when DropDownControlType="RadComboBox" and the field value is null, the first non-null value in the related data source is shown instead.

Note that this affects not only the default edit form, but also the regular read-only view. If I switch to the edit form, the DropDownList shows an empty item in the list, but the RadComboBox does not.

The effect is that when using the RadComboBox, it always looks like there's a value, even when there isn't.

Is this a bug?
Am I doing something wrong?
Is there a workaround?
Giuseppe
Telerik team
 answered on 01 Feb 2008
1 answer
186 views
I have a grid displaying a list of objects that have a Date field.

I want to group these by: those with a Date of "Today", "Yesterday" and "Older than that". I also want so that the Today group comes before the yesterday group, etc.

Alphabetically, "Older.." comes before "Today" which comes before "Yesterday".

How do I get the grid to group by these categories with clean titles, and order the groups as desired?

One of my attempts was:

I created another field in the objects that returns an enum corresponding to these states. Unfortunately, there is no way to override ToString for enums, or to specify how to sort them.

I then created a DateRegion object and added a field in my object class that returns a DateRegion object. This object has a Text Field that corresponds to the categories above. Unfortunately the grid seems to sort alphabetically by this Text.

Any ideas? Am I being clear?
Giuseppe
Telerik team
 answered on 01 Feb 2008
1 answer
193 views
I'd like to specify the temp upload folder in the web.config, this used to work in previouse versions:

<
add key="Telerik.RadUpload.TempFolder" value="value"/>


This doesn't seem to work with Prometheus. Is there a way to do this?

George
Telerik team
 answered on 01 Feb 2008
1 answer
75 views

I don't want to use the contenturl since it treats it like an iframe.  I'm trying to add an object to the rightpane - but it causes the splitters to not move and resize.

RadPane
RightPane = new RadPane();

RightPane.Controls.Add(ParseControl(

"<object id=\"iobject\" data=\"http://www.google.com\" width=\"100%\" height=\"385\" type=\"text/html\" />"));

Splitter2.Items.Add(RightPane);

George
Telerik team
 answered on 01 Feb 2008
1 answer
158 views
If I place a RadEditor into a RadTooltip, it's formating isn't as expected.

E.g. the RadEditor overruns the end of the tooltip and subsequent controls on the tooltip overlap the bottom of the RadEditor.

However if you grab the RadEditor resize bar it redraws itself correctly.

I've tried fiddling with the relative height and width but to no success.

Georgi Tunev
Telerik team
 answered on 01 Feb 2008
1 answer
97 views

Hi,

I'm creating a custom sharepoint control (ascx) which contains RadEditor control, in all the 3 modes.

This page also has some other control with submit button, apart from the page submit button.

If I enter content in Design or HTML mode and submit, the text gets saved correctly in Internet Explorer.

However, if I add any content in HTML mode and submit, the content disappears in FireFox, but works fine in design mode.

So how can I fix this?

Thanx in Advance. 

Georgi Tunev
Telerik team
 answered on 01 Feb 2008
1 answer
207 views
My application requires that I load my Prometheus RAD windows in a fixed position relative to other items on the page.  When the page loads, I am able to set the position just fine.  The problem arises if the page is loaded while the browser is not maximized and the user resizes the browser or maximizes the browser after the load.  The other page contents adjust to the new page size, but the window looses its position relative to other items on the page.

Thanks in advance.
George
Telerik team
 answered on 01 Feb 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?