Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
351 views
Hi,

I have below  javascript  function in code-behind file for expand & collapse node:

private void SetActions()

{

String sString =

@"

function SaveTreeState(action)

{

var tree = $find('" + RadTreeView1.ClientID + @"');

if(tree == null) { return; }

var nodes = tree.get_allNodes();

if(action == 'expand')

{

for(var cnt=0; cnt<nodes.length; cnt++)

{

nodes[cnt].expand();

}

}

if(action == 'collapse')

{

for(var cnt=0; cnt<nodes.length; cnt++)

{

nodes[cnt].collapse();

}

}

var expandedNodes = '';

for(var cnt=0; cnt<nodes.length; cnt++)

{

if(nodes[cnt].get_expanded())

{

expandedNodes += nodes[cnt].get_value() + '|';

}

}

SaveCookie('mpnotetreestate',expandedNodes);

}

function SaveCookie(name,value,days) {

if (days) {

if (days>730) {

days=730;

}

var date = new Date();

date.setTime(date.getTime()+(days*24*60*60*1000));

var expires = '; expires='+date.toGMTString();

}

else var expires = '';

document.cookie = name+'='+value+expires+'; path=/';

}

";

ScriptManager.RegisterClientScriptBlock(this, typeof(ViewNotes), "SaveTreeStateBlock", sString, true);

ViewToolBar1.btnExpandAll.Attributes.Add("onclick", "try{SaveTreeState('expand');}catch(err){return;}return false;");

ViewToolBar1.btnCollapseAll.Attributes.Add("onclick", "try{SaveTreeState('collapse');}catch(err){return}return false;");

}



In UI I am using the below:
<cc2:MPTreeView BorderStyle="None" OnNodeDataBound="RadTreeView1_NodeDataBound" OnClientNodeCollapsed="SaveTreeState"

OnClientNodeExpanded="SaveTreeState" ShowLineImages="false" ID="RadTreeView1" runat="server">

<CollapseAnimation Duration="100" Type="None" />

<ExpandAnimation Duration="100" Type="None" />



I am not able to collapse the treeview control on button click nor able to expand ? Could u please suggest.

Thanks
Bikash
Bikash
Top achievements
Rank 1
 answered on 02 Dec 2013
2 answers
117 views
Hi,

I want to show a RadConfirm when a certain ribbon bar button is clicked (in the client-side event handler), so the user can cancel the event.
Because the RadConfirm uses a callback, I have to cancel the click event, show the RadConfirm, and in the callback I have to do a postback if the user clicked "yes".
If found this example: http://demos.telerik.com/aspnet-ajax/window/examples/confirmserverclicks/defaultcs.aspx
How can I use this approach for a RibbonBarButton?

I have so far (pseudocode):
function OnRibbonBarButtonClicking(sender, args) {
   if (args.get_button().get_value() == "delete") {
      args.set_cancel(true);
      radConfirm("Sure?", _callbackFunc);
   }
}
 
function _callbackFunc(arg) {
   if (arg) {
      // do postback, but how?
   }
}

JP
Top achievements
Rank 1
 answered on 02 Dec 2013
6 answers
736 views
Greetings,

I'm currently evaluating RadGrid as my manager considers using it in a new project.
My manager asked me to examine the batch mode. One of his requirements is that new rows should be added to the bottom of the grid instead of the current behaviour of adding to the top.

addNewRecord adds to the top by default. Can I configure the grid to change this behaviour?
And if the answer is no, can I resort to a DOM hack to add the record TR element to the bottom? Will this be safe?
أشرف
Top achievements
Rank 1
 answered on 02 Dec 2013
1 answer
284 views
How to get value form select autocomplete entrise 
Princy
Top achievements
Rank 2
 answered on 02 Dec 2013
1 answer
121 views
When you add the filter and EnableRangeFiltering is set to true it shows the to and the from on the same line, is there a way to have it right justified and on 2 lines?
Venelin
Telerik team
 answered on 02 Dec 2013
1 answer
107 views

Hi There

I have a RadComboBox

And definition look like this

<telerik:RadComboBox Filter="Contains" runat="server" ID="cmbTechnicalServicePerson" Width="420px"

        MarkFirstMatch="true" DataSourceID="DSGetTechnicalServicePerson"

        HighlightTemplatedItems="true" OnClientItemsRequested="UpdateItemCountField"

        OnDataBound="cmbTechnicalServicePerson_DataBound" OnItemDataBound="cmbTechnicalServicePerson_ItemDataBound"

        LabelWidth="100" Label="Technical Service Name:" Skin="Office2010Black" Style="position: absolute; top: 310px; left: 21px; z-index: 6500; height: 16px;" EmptyMessage="Select  a Value" TabIndex="3">

        <HeaderTemplate>

            <ul>

                <li class="col1">Name</li>

                <li class="col2">Position</li>

                <li class="col2">Unit</li>

            </ul>

        </HeaderTemplate>

        <ItemTemplate>

            <ul>

                <li class="col1">

                    <%# DataBinder.Eval(Container.DataItem, "[FULLNAME]")%></li>

                <li class="col2">

                    <%# DataBinder.Eval(Container.DataItem, "Position")%></li>

                <li class="col3">

                    <%# DataBinder.Eval(Container.DataItem, "[Department]")%></li>

            </ul>

        </ItemTemplate>

        <FooterTemplate>

            A total of

                    <asp:Literal runat="server" ID="RadComboItemsTCount" />

            items

        </FooterTemplate>

 

    </telerik:RadComboBox>

Some time user would like to un select the selected value but this setting  does not allow them. Initial the EmptyMessage="Select  a Value" appear but as soon as they select something they will not be able to unselect to the empty value

Can someone please give some suggestion?

Many thanks

Syed

Nencho
Telerik team
 answered on 02 Dec 2013
5 answers
97 views
Greetings,

My manager asked me to achieve some UI behaviours that I thought should be implemented by creating a new grid column type.

I read through the documentation but still can't make my mind on how to achieve the required functionality.

Is it necessary to create a custom column editor (inheriting from GridColumnEditorBase)? Or just inheriting from GridEditableColumn will be sufficient? Taking into account that we plan to use the batch mode heavily, so we will need some client side coding.

Are there any examples covering this subject?
Antonio Stoilkov
Telerik team
 answered on 02 Dec 2013
2 answers
129 views
Hell friends,
I have used RadTabStrip in my one of my application asp.net page. When the page is rendering in the IE browser the RadTabStript width is going weird to some about 5310px width and stretching the page horizontally. When I see in the developer toolbar the width="5310px"  is being written to <ul> tag. This <ul> tag is part of RadTabStrip. Can anybody help me to solve this problem.

P.S: I have already tried to set ul { width:100%!important; } but not working
Sumit
Top achievements
Rank 1
 answered on 02 Dec 2013
3 answers
151 views
If you are viewing the HTML tab in the Editor when submitting, it doesn't do the Word format strip.  It doesn't work in the demo:  http://demos.telerik.com/aspnet-ajax/editor/examples/cleaningwordformatting/defaultcs.aspx

I tried it in both IE and Chrome.  It does work if you are viewing the Design or Preview option.  I assume this has something to do with the HTML content being in an IFrame.

I had searched around on the forum but did not find anything about this being a known issue.  If there is a workaround, I would like the steps.  

Thanks!



Ianko
Telerik team
 answered on 02 Dec 2013
3 answers
200 views
Hi,

When I try to add new record using telerik add new record command, the edit form cannot be closed.
If anyone have ever encountered this issue, please do share. Thanks.

Please find below the aspx and codebehind:

 

                    <telerik:RadGrid ID="RadGrid1" ShowStatusBar="true" Height="420px" EnableAJAX="true" 
                        runat="server" AutoGenerateColumns="False" AllowSorting="true" AllowMultiRowSelection="False" 
                        AllowPaging="true" GridLines="None" ShowFooter="true"   
                        AllowFilteringByColumn="false" EnableDrag="false" 
                        EnableHeaderContextMenu="false" TableLayout="auto"   
                        AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
                        AllowAutomaticUpdates="True" PageSize="10"   
                        OnNeedDataSource="RadGrid1_NeedDataSource"   
                        OnItemDataBound="RadGrid1_ItemDataBound" 
                        OnUpdateCommand="RadGrid1_UpdateCommand"   
                        OnInsertCommand="RadGrid1_InsertCommand"   
                        OnDeleteCommand="RadGrid1_DeleteCommand"   
                        onitemcommand="RadGrid1_ItemCommand" 
                        > 
 
        protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)  
        {  
            // Perform insert  
 
            RadGrid1.MasterTableView.ClearEditItems();  
        } 

 

 


Regards,
canfield
MVP
Top achievements
Rank 1
 answered on 02 Dec 2013
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?