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

I am adding Node Templates like;
protected void RadTreeView2_TemplateNeeded(object sender, RadTreeNodeEventArgs e)
{
    bool someCondition = true;
    if (someCondition)
        e.Node.NodeTemplate = new BoxTemplate();
    else
        e.Node.NodeTemplate = new OtherTemplate();
}

And here is my BoxTemplate class;
class BoxTemplate : ITemplate
{
    public void InstantiateIn(Control container)
    {
        Label nodeLabel = new Label();
        nodeLabel.ID = "NodeLabel";
        nodeLabel.DataBinding += new EventHandler(NodeLabel_DataBinding);
        container.Controls.Add(nodeLabel);
 
        ImageButton delButton  = new ImageButton();
        delButton.ImageUrl = "~/images/icons/delete16.png";
        delButton.OnClientClick = "return ConfirmDelete();";
        container.Controls.Add(delButton);
     }
 
    private void NodeLabel_DataBinding(object sender, EventArgs e)
    {
        Label theLabel= (Label)sender;
        RadTreeNode node = (RadTreeNode)theLabel.BindingContainer;
        theLabel.Text = (string)DataBinder.Eval(node, "Text");
    }
}

I couldn't figure it out how to add server side click event to my delButton and handle it at code behind.
Any help would be appreciated. TIA.
Princy
Top achievements
Rank 2
 answered on 10 May 2012
1 answer
222 views

Dear all

I wonder if somebody could help clarify something about the persistence behaviour I should be expecting from the RadTreeView's EnableViewState property? I am not sure if I am seeing the behaviour by design or not ...

I have a RadTreeView control which does not appear to maintain its node display arrangement after a postback, in that if the user expands a node, after postback the node has been collapsed once more. Also, when it comes to the underlying datasource bindings etc of the RadTreeView control, it seems as though the control does not persist the Datasource property, for example, that is configured when the control first loads on the initial post of the page. For example, the RadTreeView in question binds to a hierarchical datasource object, but I am having to reconfigure the RadTreeView to a datasource object after each postback, which seems a little counter-intuitive, and a bit of an inefficiency that I would expect the RadTreeView control to avoid by maintaining the state of the datasource object. Perhaps the data configuration and hierarchy display changes would need to be made manually with a Session object instead?

However, I would be interested to know if this is the correct way to go about this issue, or whether I am missing something of importance. 

Thanks very much for any advise!

Regards

Plamen
Telerik team
 answered on 10 May 2012
5 answers
326 views
Hello,

There is a very similar problem with <GridDateTimeColumn>, as this message: http://www.telerik.com/community/forums/reply-thread.aspx?messageId=2088875&threadId=530174 .

However, this problem still happens after the Telerik.Web.UI_2012_1_424_Dev release build.


My problem:

I have a grid with EditForm edit mode enabled.

When I select an editable field that fires a OnTextChanged post back event, if I give focus to an editable <GridDateTimeColumn> field, I get a problem.

Prior to this hotfix, I would get an error the same error: "Text property cannot be set. String was not recognized as a valid DateTime."

After this hotfix, what happend is when I focus an editable <GridDateTimeColumn> field, the contents of the field disappear. Actually, the contents appear to first be selected, then they disappear. Focusing on other types of columns does not do this.

Normal behavior (and expected), as when tabbing from field to field without this post back event, the items are selected. But the selection is not removed.

Here are the two date/time column definitions in my grid, demonstrating the problem:

<telerik:GridDateTimeColumn DataField="ValidFromDate"
    FilterControlAltText="Filter ValidFromDate column" HeaderText="Valid From"
    UniqueName="ValidFromDate" DataFormatString="{0:MM/dd/yyyy}"
    MinDate="1901-01-01" MaxDate="9999-12-31 23:59:59.999999">
</telerik:GridDateTimeColumn>
 
<telerik:GridDateTimeColumn DataField="ValidToDate"
    FilterControlAltText="Filter ValidToDate column" HeaderText="Valid To"
    UniqueName="ValidToDate" DataFormatString="{0:MM/dd/yyyy}"
    MinDate="1901-01-01" MaxDate="9999-12-31 23:59:59.999999">
</telerik:GridDateTimeColumn>


Here is the column that fires the OnTextChanged event while in Edit-Mode (see <EditItemTemplate>):

<telerik:GridTemplateColumn HeaderText="Override Discount $" UniqueName="OverrideDiscount">
     
    <ItemTemplate>
         
        <telerik:RadNumericTextBox NumberFormat-DecimalDigits="2"
            ID="txtOverrideDiscountDsp" runat="server"
            gmNumberFormat-AllowRounding="False" Type="Currency" Width="52px"
            BackColor="Transparent" BorderStyle="None"
            Value='<%#CoalesceNumericValuesToRadNumberControl(DataBinder.Eval(Container.DataItem, "UpdateCustomerPrice"), null) %>'>
        </telerik:RadNumericTextBox>              
         
    </ItemTemplate>
                     
    <EditItemTemplate>
        <telerik:RadNumericTextBox NumberFormat-DecimalDigits="2" ID="txtOverrideDiscount" runat="server"
            AutoPostBack="true" OnTextChanged="txtOverrideDiscount_OnTextChanged"
            gmNumberFormat-AllowRounding="False" Type="Currency"
            Value='<%#CoalesceNumericValuesToRadNumberControl(DataBinder.Eval(Container.DataItem, "CustomerPrice"), null) %>'>
        </telerik:RadNumericTextBox>
    </EditItemTemplate>
 
</telerik:GridTemplateColumn>

Thanks

saxan.sartar (at) gmail (dot) com 
Antonio Stoilkov
Telerik team
 answered on 10 May 2012
2 answers
285 views
Hello,

It's urgent.
Am using vb.net 2010.
I have master table view and detail table view with command items at top.
In master table view i can hide link button using
1. for Add new link button: Visible='<%# Not rgView1.MasterTableView.IsItemInserted %>'
2. for Cancel button:  Visible='<%# rgView1.EditIndexes.Count > 0 Or rgView1.MasterTableView.IsItemInserted %>
How to achieve the above two in detail table?
I tried using Visible='<%# Not(Container AS GridItem).OwnerTableView.IsItemInserted %>'
But it throws error as Operator Not is not defined for type GridItem.

Please guide me
Thank you
Jayanthi
jayanthi
Top achievements
Rank 1
 answered on 10 May 2012
1 answer
116 views
 How to show signs for numbers in the RadNumericTextbox .Like setting +/- for numbers?
Princy
Top achievements
Rank 2
 answered on 10 May 2012
1 answer
94 views
How to pass the cell value that is selected in a grid to a textbox in templatcolumn?
Shinu
Top achievements
Rank 2
 answered on 10 May 2012
0 answers
86 views

I have a Rad Grid control on a form! and it works totally fine on localhost. But when i deploy project on server the grid hyperlinks did'nt work!

it did'nt open any pop up window but on localhost it works fine! and this issue is in soo many pages!

Can anyone help me! what i am doing wrong in deploying!

Muhammad Haroon
Top achievements
Rank 1
 asked on 10 May 2012
4 answers
225 views
Hello, 

How can I change the default setting of the Crop tool from Constrained Proportions to Unconstrained Proportions.

I see many threads about defining the size, ratio and disabling buttons for easy thumbnail creation, but I just need to change the default to Unconstrained. 
Brad
Top achievements
Rank 1
 answered on 09 May 2012
1 answer
185 views
I have a dynamic columns and dynamic rows which am binding in rad grid
ex:-


name col1 col 2 col3 col4  TOtal
a  -----1------4-----5-----7 --------- 45
b ------1------4-----5-----7  --------- 45 
c ------1------4-----5-----7  --------- 45 
tota--16-----64---65----67  ----------100


now i want to insert item template in all this values so that user can enter numeric fields .. also i want regular expressions
i dont have any name of columns since user can edit column names also ... also TOTAL 
please tell me how can i do this 
Richard
Top achievements
Rank 1
 answered on 09 May 2012
1 answer
234 views
i am trying to use GridHyperLinkColumn to be able to download file, everything works perfect except downloading the file.
the link appears successfully but when clicking on it nothing happens.

<telerik:GridHyperLinkColumn HeaderText="File"  UniqueName="FILE"  DataTextField="Original_FileName"  Target="_blank"  DataNavigateUrlFields="Physical_FileName"></telerik:GridHyperLinkColumn>

I am using the following structure:

RadAjaxManager in  the MasterPage
RadAjaxManagerProxy in the ContentPage wich host the RadGrid which is inside RadAjaxPanel
Maria Ilieva
Telerik team
 answered on 09 May 2012
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?