Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
123 views
I am trying to change one element in the NodeTemplate of a Treeview and my code is not working. It executes fine but the change doesn't show up on the screen. What am I doing wrong?

Here is the the code:
protected void RadTreeView1_NodeDataBound (object sender, RadTreeNodeEventArgs e)
{
    e.Node.ExpandMode = TreeNodeExpandMode.ServerSide;
    if (e.Node.Text == "Retailers")
    {
        RadTreeNode node = RadTreeView1.Nodes[0];
        HyperLink hyperLink = (HyperLink)node.FindControl ("HyperLink2");
        hyperLink.Visible = false;  // this what is want to do
        hyperLink.Text = "<span style=\"color: #BBBBBB\">X</span>"; // this is test to see that the Hyperlink Text changes
    // Neither of the above two lines produce the screen changes I am looking for
      }
}

Here is the defintion
<telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="True" MultipleSelect="True"
    EnableViewState="true" ShowLineImages="False" EnableEmbeddedSkins="False" Skin="tree_2"
    OnNodeClick="RadTreeView1_NodeClick" OnNodeDataBound="RadTreeView1_NodeDataBound"
    OnClientNodeCollapsed="OnClientNodeCollapsed" OnClientNodeExpanded="OnClientNodeExpanded" OnClientLoad="onLoad">
    <NodeTemplate>
        <small>
            <asp:Label ID="lblnodeText" Text='<%#Eval("Title") %>' runat="server" /><asp:Label
                ID="lblCatId" Text='<%#Eval("Id") %>' runat="server" Visible="false"></asp:Label><asp:Label
                    ID="lblisCustomer" Text='<%#Eval("isCustomer") %>' runat="server" Visible="false"></asp:Label><asp:Label
                        ID="Description" runat="server" Text='<%#Eval("description") %>' Visible="false" /><asp:HiddenField
                            ID="DescriptionVisible" runat="server" Value='<%#Eval("descriptionVisible") %>' />
        </small>
        <small>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl=<%# "javascript:Popup_Window('category_detail','" + DataBinder.Eval(Container.DataItem, "id").ToString() + "')"%> style="text-decoration: none;"><span style="color: #BBBBBB">e</span></asp:HyperLink>
        </small>
    </NodeTemplate>
</telerik:RadTreeView>
Kate
Telerik team
 answered on 01 Jul 2013
1 answer
239 views
In the following example, can you explain me why the RadTabStrip1_TabClick server event is not fired ?
The event is fired only if I remove the Button1 AjaxSetting. 
How can I keep the loading panel and raise the server event ?

<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="ScriptManager" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/jquery.min.js" />       
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Button1" EventName="Click">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>           
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
 
    <asp:Button ID="Button1" runat="server" OnClientClick="ChangeTab()" Text="Click here if you really want to change tab" style="display:none" />
    <asp:Panel ID="Panel1" runat="server">
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" AutoPostBack="true" OnClientTabSelecting="RadTabStrip1_ClientTabSelecting"
            SelectedIndex="0" ontabclick="RadTabStrip1_TabClick" >
        <Tabs>
            <telerik:RadTab Text="Tab A" PageViewID="PageViewA" ></telerik:RadTab>
            <telerik:RadTab Text="Tab B" PageViewID="PageViewB" ></telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" >
        <telerik:RadPageView ID="PageViewA" runat="server">
            Tab a<br />
            <asp:Label ID="labelViewA" runat="server" Text="Not updated by the server yet"></asp:Label>      
        </telerik:RadPageView>
        <telerik:RadPageView ID="PageViewB" runat="server">
            Tab b<br />
            <asp:Label ID="labelViewB" runat="server" Text="Not updated by the server yet"></asp:Label>      
        </telerik:RadPageView>
     </telerik:RadMultiPage>
     </asp:Panel>
     <telerik:RadScriptBlock ID="RadScriptBlock" runat="server">
        <script language="javascript" type="text/javascript">
             
            var lastTabClickedItem = null;
            var changeTabConfirmed = false;
 
            function RadTabStrip1_ClientTabSelecting(sender, eventArgs)
            {
                var button1 = $('#<%= Button1.ClientID %>');
                if (changeTabConfirmed == true) {
                    changeTabConfirmed = false;                   
                    button1.hide();
                }
                else {
                    eventArgs.set_cancel(true);
                    lastTabClickedItem = eventArgs.get_tab();               
                    button1.show();
                }
            }
 
            function ChangeTab() {
                changeTabConfirmed = true;
                lastTabClickedItem.click();
            }
        </script>
     </telerik:RadScriptBlock>
    </form>
</body>

protected void RadTabStrip1_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
{
    if (e.Tab.PageViewID == "PageViewA")
    {
        labelViewA.Text = "Updated by the server";
    }
    else
    {
        labelViewB.Text = "Updated by the server";
    }           
}

Thank you
Eyup
Telerik team
 answered on 01 Jul 2013
11 answers
1.2K+ views
I am quite new to the ajax world, so if this is a rookie question, please be patient with me. I'm still learning.

I have a situation where I don't want to perform a postback until the user confirms that it is OK to perform a certain action. However, on postback, if the data that is sent isn't valid, the function should alert the user to one of several potential problems with the data, but if the data is valid, go ahead and update certain selected controls on the form.

If I use an ajax request, I can get success or failure and alert the user about the problem if it exists, however, I am not sure how to update the controls or prevent their update depending upon the value returned from the server.

Essentially, I want to have the user confirm via a radwindow, then if the confirmation is affirmative, then perform an ajax POST request with the data. If the server returns success, I want to then update a series of controls, however, if the server returns an error, I want to show a radwindow with the error returned from the server and leave the page exactly as it is.
Maria Ilieva
Telerik team
 answered on 01 Jul 2013
5 answers
250 views
I am trying to put together a general purpose pivot table, so I don't really know what columns they will be needing. As a result I have a lot of hidden fields. 

Is it possible to get a scrollbar on that window? You can expand it of course, but only gives me 35 to 40 hidden fields. Expanding the width only makes the objects wider, it it would switch to multiple columns that would be a good alternative to a scrollbar.

Thanks
Randy Miller
Venelin
Telerik team
 answered on 01 Jul 2013
3 answers
173 views
How would you use foreign key data to populate the DetailsTables grid?

I am using onneeddatasource to populate the MasterTableView. I am also using linq as my datasource.
Andrey
Telerik team
 answered on 01 Jul 2013
1 answer
117 views
Hi, 

We've recently upgraded from Q3 2010, mainly to accommodate for IE10. We've had various issues but most of the functional ones are resolved after searching in this forum. Those are like changes of visible=false to display=false. We're left with UI problem, mostly have to do with font size and RadTextBox & RadComboBox width changes, which distorted our layout.

We uses textboxes in a lot of pages and we have our own textbox control which inherit from RadTextBox (we only override non display related attributes/parameters), which we later set WrapperCssClass in the constructor based on some advise we found in this forum. Is there any simple way we can reset the textbox and combobox to look like how they appears before in Q3 2010 without having to modify every single page? 

We've tried to use WrapperCssClass to set all the textboxes width to auto and it appears to work in IE10, IE9/8, Firefox and Chrome, although the size seems to be smaller than before. But when we turn on Compatibility mode in IE10/9/8, the textboxes will appear bigger, and the layout distorted again. It feels like font size changes. As for RadComboBox, on some pages, it fill the width of the container and WrapperCssClass doesn't exist in RadComboBox for us to apply the similar change like RadTextBox.

We then try to find out if this problem appears in the Live Demo, but VS2010 crashes when loading the solution. On VS2012 it does load, but we then fail to set the target framework to .Net3.5. It's either it crashed or the page throws exception about incompatible runtime version. How should I make it work in VS2010 with .Net 3.5

Thank you


Galin
Telerik team
 answered on 01 Jul 2013
2 answers
625 views
Hi, i have this code and I dont know how to resolve the exception. The action is executed when i press a button btnExportar

protected

 

 

void BtnExportar_Click(object sender, EventArgs e)

 

 

{

 

 

 

 

List<Festivo> listaFestivos = ....

 

//se crea un RadGrid vinculado a la lista de festivos.

 

RadGrid rg = new RadGrid();

 

//configuramos el radGrid para que tenga una sola columna

 

GridBoundColumn columnaFestivos = new GridBoundColumn();

columnaFestivos.UniqueName =

 

"Festivos";

 

 

columnaFestivos.DataField = 

 

"Fecha";

 

 

columnaFestivos.HeaderText = 

 

"Festivos";

 

 

rg.MasterTableView.Columns.Add(columnaFestivos);

rg.DataSource = listaFestivos;

rg.DataBind();

 

 

 

this.Exportar(rg);

}

 

 

 

private void ConfigureExport(RadGrid rg)

{

rg.ExportSettings.ExportOnlyData =

 

true;

 

 

rg.ExportSettings.HideStructureColumns = 

 

true;

 

 

rg.ExportSettings.IgnorePaging =

 

true;

 

 

rg.ExportSettings.OpenInNewWindow = 

 

true;

 

 

rg.Columns[0].Visible = 

 

false;

 

 

}

 

 

 

 

public void Exportar(RadGrid rg)

{

ConfigureExport(rg);

rg.MasterTableView.ExportToExcel();

}

can you help me? thanks

 

Mihir
Top achievements
Rank 1
 answered on 01 Jul 2013
4 answers
417 views
Good day.
With the release 2013.2 I assign the value of a tbox with the script:

$("#RadWindowDataEntryArticolo_C_tboxArticoloCodice_tbox").val(Codice)

In code behind the text property is blank. After a click in the control, the text property, is what I'm expected.
What's wrong ?
PAOLO
Top achievements
Rank 1
 answered on 01 Jul 2013
4 answers
211 views
Hi,

I have a needatasource radgrid that allows inline vb.net edits.  What I want to do is let the user make any edits to the grid values and then dump the grid to the DB by a Save Button.  I can't save each edit one at a time because the table needs to be dumped and resaved because of an ordering issue and I won't know the correct order until the person is done making all the edits...  Is this possible?
Kostadin
Telerik team
 answered on 01 Jul 2013
1 answer
148 views
Hi ,
         In Project i have create one insert form with validation and editable gridview it shows in same page .In this i want to update details in gridview .But validation control for insert form will takes place in gridview update event. So i want to make cause validation  false for gridview update.Please give me a solution.

Thanks,
Arun.
Konstantin Dikov
Telerik team
 answered on 01 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?