Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
166 views
When the Telerik treeview is used and the node's ExpandMode is set to ServerSide, selecting a node causes postback to occur. The existing tree has a lot of nodes. This causes a delay when trying to select other nodes. We avoid the postback that occurs after node selection by using the OnClientNodeChecking and set_cancel(true) methods. Our problem is that when going to the server, the tree is loosing its state. In cases where expanding a node also causes postpack, we would like to know if there is a way to save the state of the treeview nodes before the postback occurs so that we can be aware of the state of the nodes on the server. (We want to use this implementation).
Shinu
Top achievements
Rank 2
 answered on 11 Jun 2009
1 answer
145 views
I have amout 25000 data items. They are grouped first by the Person after by an ID and third by another Value.
Actually it loads, but slowly! more than 10 seconds to list all. They are grouped with the grouped by expressions.

All columns are not expanded at start. So it should even load the second hierarchy when i click on a first hierarchy item one.

Whats best quickest way for that?

Thanks.
Veli
Telerik team
 answered on 11 Jun 2009
7 answers
216 views
I found the article by Kevin Babcock on the blogsite, but the c# zip file seems to be corrupt.  anybody know where I can find the code for this.

Thanks


Sonya
Telerik team
 answered on 11 Jun 2009
3 answers
271 views

Hi, I have created a user control of RadComboBox with Checkboxes. It has Select All checkbox as HeaderTemplate. All selected values are displayed in the textbox of RadComboBox. It works fine for single instance of user control.

But when I add multiple controls in a page, any checkbox click event refers to last user control added. i.e. Select All, or any checkbox click event refers to last created dropdown. Any help is appreciated.

Here is the code of my user control DropdownControl.ascx

 

<

script type="text/javascript">  

 

 

 

var cancelDropDownClosing = false;  

 

function StopPropagation(e)

 {

 

    //cancel bubbling

 

 

 

   e.cancelBubble = true;

 

 

 

    if (e.stopPropagation)

 

 

     {

        e.stopPropagation();

    }

}

 


function
onDropDownClosing()

 

 

{

    cancelDropDownClosing =

false;

 

 

}

 

function onCheckBoxClick(chk)

 

 

{

 

    var combo = $find("<%= RadComboBox1.ClientID %>");

 

    //if any item is selected, uncheck select all

 

 

 

    if (AllSelected() == true)    

 

 

     {

 

        var chkall = $get(combo.get_id() + "_Header_SelectAll");

 

 

         chkall.checked =

true;

 

 

    }

 

    else

 

 

 

    {

 

 

 

        var chkall = $get(combo.get_id() + "_Header_SelectAll");

 

 

         chkall.checked =

false;

 

 

     }

 

//holds the text of all checked items

 

 

 

 var text = "";

 

 

 

//holds the values of all checked items

 

 

 

 var values = "";

 

 

 

 

//get the collection of all items

 

 

var items = combo.get_items();

 

 

 

 

//enumerate all items

 

 

 

for (var i = 0; i < items.get_count(); i++)

 

 {

 

var item = items.getItem(i);

 

 

 

//get the checkbox element of the current item

 

 

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

 

if (chk1.checked)

 

 

 {

text += item.get_text() +

"," ;

 

 

 values += item.get_value() +

",";

 

 

 }

}

 

 

//remove the last comma from the string 

 

text = removeLastComma(text);

 

 values = removeLastComma(values);

 

if (text.length > 0)

 

 

 {

 

//set the text of the combobox

 

 

 

combo.set_text(text);

 

 

}

 

else

 

 

 

{

 

 

 

//all checkboxes are unchecked

 

 

 

//so reset the controls

 

 

 

combo.set_text("");

 

 

 }

}

 

 

//this method removes the ending comma from a string

 

 

 

function removeLastComma(str)

 

 

 {

 

    return str.replace(/,$/,"");

 

 

 }
 

 

//Check if any one value is selected in drop down 

 

function AnyOneSelected()

 

 

{

 

var combo = $find("<%=RadComboBox1.ClientID %>");

 

 

 

var items = combo.get_items();

 

 

 

 

for(var i = 0; i < items.get_count(); i++)

 {

 

var item = items.getItem(i);

 

 

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

 

if (chk1.checked)

 

 

{

 

return true;

 

 

 }

 }

 

return false;

 

 

 }

 

 

//Check if all the values are selected in drop down

 

 

 

 

 

function AllSelected()

 

 

{

 

var combo = $find("<%=RadComboBox1.ClientID %>");

 

 

 

 

var items = combo.get_items();

 

 

 

for(var i = 0; i < items.get_count(); i++)

 

{

 

var item = items.getItem(i);

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

 

if (chk1.checked == false)

 

{

 

return false;

 

 

 }

 }

 

return true;

 

 

 }

 

 

//Handle Select All click

 

 

 

function selectAllClick(chk)

 

 

 {

 

//if selectAll = true; check All ; otherwise uncheck all

 

 

 

var selectAll = true;

 

 

 

if (AnyOneSelected() == true)

 

 

 selectAll =

true;

 

 

 

 

if (AllSelected() == true)

 

 

 selectAll =

false;

 

 

 

 

//holds the text of all checked items

 

 

 

var text = "";

 

 

 

//holds the values of all checked items

 

 

 

var values = "";

 

 

 

var combo = $find("<%=RadComboBox1.ClientID %>");

 

 

 

var items = combo.get_items();

 

for(var i = 0; i < items.get_count(); i++)

 {

 

var item = items.getItem(i);

 

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

if (selectAll)

 

 chk1.checked =

true;

 

 

else

 

 

chk1.checked = false;

 

 

if (chk1.checked)

 

{

text += item.get_text() +

"," ;

 

 values += item.get_value() +

",";

 

 }

 }

 

 

//remove the last comma from the string

 

text = removeLastComma(text);

values = removeLastComma(values);

 

if (text.length > 0)

 

//set the text of the combobox

 

combo.set_text(text);

 

else

 

 

//all checkboxes are unchecked

 

 

//so reset the controls
combo.set_text("");

 

 }

 

 

</

script>

 

 <

div>

 

 

<table>

 

 

<tr>

 

 

<td style="height: 43px">

 

 

<telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="Vista" AllowCustomText="true"

 

 

HighlightTemplatedItems="false" OnClientDropDownClosed="onDropDownClosing">

 

 

<HeaderTemplate>

 

 

<asp:CheckBox runat="server" ID="SelectAll" onclick="selectAllClick(this)" />

 

 

<asp:Label runat="server" ID="hdrLabel" AssociatedControlID="SelectAll">Select All</asp:Label>

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<div onclick="StopPropagation(event)" class="combo-item-template">

 

 

<asp:CheckBox runat="server" ID="chk1" onclick="onCheckBoxClick(this)" />

 

 

<asp:Label runat="server" ID="label1" AssociatedControlID="chk1"><%# DataBinder.Eval(Container, "Text") %></asp:Label>

 

 

</div>

 

 

</ItemTemplate>

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 </

div>

 

 

 

The properties are implemented just to bind dropdown to stored procedure. The Select All and everything works fine if I add only one control. But if I add another control dd2, all click events in dd1 refers to dd2.


Web.Reporting.WebCommon.Controls.
DropdownControl dd1 = (Web.Reporting.WebCommon.Controls.DropdownControl) LoadControl("~/WebCommon/Controls/DropdownControl.ascx");

 dd1.cs =

ConfigurationManager.ConnectionStrings["CS"].ToString();

 

 dd1.DataSourceProcedureName =

"uspGetPortfolioAssetType";

 

 dd1.DataTextField =

"portfolioAssetType";

 

 dd1.DataValueField =

"portfolioAssetTypeId";

 

 

 

Web.Reporting.WebCommon.Controls.DropdownControl dd2 = (Web.Reporting.WebCommon.Controls.DropdownControl) LoadControl("~/WebCommon/Controls/DropdownControl.ascx");

 

 dd2.cs =

ConfigurationManager.ConnectionStrings["CS"].ToString();

 

 dd2.DataSourceProcedureName =

"uspGetAssetClass";

 

 dd2.DataTextField =

"assetClassDescription";

 

 dd2.DataValueField =

"assetClassId";

 

 

 

 

 

 

 

           

Veselin Vasilev
Telerik team
 answered on 11 Jun 2009
1 answer
218 views
Hi,

I have a RadGrid with a NestedViewTemplate in a DetailTable in a DetailTable.
So the grid (without columns etc) looks like this :
<telerik:RadGrid ID="customerRadGrid">  
    <MasterTableView DataKeyNames="CustomerID">  
      <DetailTables> 
         <telerik:GridTableView DataKeyNames="ProductID">  
            <ParentTableRelation> 
              <telerik:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" /> 
            </ParentTableRelation> 
            <DetailTables>   
              <telerik:GridTableView DataKeyNames="SupplierID">  
                <ParentTableRelation> 
                  <telerik:GridRelationFields DetailKeyField="ProductID" MasterKeyField="ProductID" /> 
                </ParentTableRelation> 
                <NestedViewTemplate> 
                      <asp:Button ID="startButton" runat="server" Text="Start"   
                        onclick="startButton_Click" />                    
                </NestedViewTemplate> 
              </telerik:GridTableView>                
            </DetailTables> 
         </telerik:GridTableView> 
      </DetailTables> 
    </MasterTableView> 
  </telerik:RadGrid> 


In the template there is a button for the user to click.
When the user clicks the button i need to know what the parent row is, so i can get the datakeyvalue of that row.

I tried this by setting the row to selected as soon as the user expands it but since there can be multiple rows expanded this isn't working.

Anybody any ideas?
Princy
Top achievements
Rank 2
 answered on 11 Jun 2009
1 answer
155 views
I'm using Q3 2008 1105 and I want to add an 'X-to-close' button onto the 'ShowOnFocus' toolbar, so that the user can get rid of the toolbar after they have finished editing by clicking a 'X' on the toolbar, rather than having to change the focus to a non-editable area.

I am okay with the process of adding the button but I cannot find any documentation showing a client-side method of hiding the toolbar.

I don't want to permanently remove the toolbar. I want it to re-appear if they click back on that editor area again.

This is the process for a user:

1) User clicks an editable area on the page.
2) Toolbar pops-up via 'showonfocus'.
3) User makes some changes.
4) User clicks 'X' button to close the toolbar.
5) User click the editable area again.
6) Toolbar re-appears.

I really appreciate any help you can give me.
Rumen
Telerik team
 answered on 11 Jun 2009
2 answers
47 views
Hello,
I have a question for RadWindow for the case in which the content inside loads in 3-4 seconds.

If I'm opening the window 2 times sequentially (open, close, then open again), on the second opening is there any way I can hide the content already loaded from the first time until the page finishes loading? (the content of the first load is shown imediatly I open the popup, until the iframe inside gets the response from the server for the second request)

Thanks,
Lucian

PS: I am using RadControls for ASPNET AJAX Q3 2008.
Lucian Duma
Top achievements
Rank 1
 answered on 11 Jun 2009
1 answer
117 views
Dear Telerik Team

Is there any way to change the RadGrid default behavior when I select an item?
the default works like windows grids, so if i select one item every other are deselected, but if I press the control key and then I select one item the grid mantains the selection.
What I need is that the grid works like if the control key were pressed all the time. I will appreciate very much if you could pots an example of code for doing this.

Thanks in advance.
Elian
Pavlina
Telerik team
 answered on 11 Jun 2009
4 answers
269 views
Hello!

I need to set the height of a radtreeview. it works fine if i set it absolute (like 800px) but if i can't set it in relation to the page - 90% for example.

Isn't it possible?
Princy
Top achievements
Rank 2
 answered on 11 Jun 2009
2 answers
166 views
Hi

Can you see why the loading panel isn't working on the code below. I can't see why not. It looks the same as my other pages.

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

head runat="server">

 

 

<title>Untitled Page</title>

 

</

 

head>

 

<

 

body>

 

 

<form id="form1" runat="server">

 

 

<div>

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server">

 

 

</asp:ScriptManager>

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="Button1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<asp:Button ID="Button1" runat="server" Text="Button" />

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" Visible="False">

 

 

<MasterTableView>

 

 

<SortExpressions>

 

 

<telerik:GridSortExpression FieldName="GPSDateTime" />

 

 

</SortExpressions>

 

 

<GroupByExpressions>

 

 

<telerik:GridGroupByExpression>

 

<

 

SelectFields>

 

<

 

telerik:GridGroupByField FieldName="RoadTypeID" HeaderText="Road Type" FieldAlias="RoadTypeID" FormatString="" />

 

</

 

SelectFields>

 

 

<GroupByFields>

 

 

<telerik:GridGroupByField FieldName="RoadTypeID" HeaderText="Road Type" FieldAlias="RoadTypeID" FormatString="" />

 

 

</GroupByFields>

 

 

</telerik:GridGroupByExpression>

 

 

</GroupByExpressions>

 

 

</MasterTableView>

 

 

<HeaderContextMenu>

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</HeaderContextMenu>

 

 

<FilterMenu>

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</FilterMenu>

 

 

 

 

</telerik:RadGrid>

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"

 

 

Width="75px">

 

 

<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'

 

 

style="border: 0px;" />

 

 

</telerik:RadAjaxLoadingPanel>

 

 

</div>

 

 

</form>

 

 

</

 

body>

 

</

 

html>

many thanks

 

Dimo
Telerik team
 answered on 11 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?