inline edit with template column

4 posts, 0 answers
  1. Lucien
    Lucien avatar
    13 posts
    Member since:
    Nov 2010

    Posted 08 Dec 2010 Link to this post

    Hi,

    first of all i would like to thank you guys for this very nice component.
    I remember how i spent at least 3 months to implement a Self-referencing Hierarchy radgrid
    with inline edit. It was really though and almost a nightmare.
    When i saw this new component, i was like, omg finally they did it!
    Well almost, because a lot of feature are still missing now...

    I know the features will come later in the next release hopefully, probably between february and march,
    but i can not wait and have to launch our website already in february.

    Well, i have a treelist with 2 columns, a boundcolumn and a templatecolumn.
    The templatecolumn is a radnumerictextbox.
    Now, i can enter some value in each radnumerictextbox inside the templatecolumn.
    So far so good.
    Now my problem: how to retrieve all these value and save them when the user clicks
    on a save button?

    Please tell me it's possible riht now or you have maybe already done a lab for that or
    can attach some demo example.

    I tried again with Self-referencing Hierarchy radgrid but it's "buggy" and i don't want to mess
    again with all the issues i had last time.

    Thank you very much for your help and assistance.
    Lucien
  2. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 13 Dec 2010 Link to this post

    Hi Lucien,

    To achieve the desired functionality you could try getting the values from RadNumericTextBox when the save button is clicked with the following code snippet:
    <telerik:RadTreeList runat="server" ID="RadTreeList1" AutoGenerateColumns="false" DataKeyNames="ID" ParentDataKeyNames="PID">
      <Columns>
        <telerik:TreeListBoundColumn DataField="ID" HeaderText="ID">
        </telerik:TreeListBoundColumn>
        <telerik:TreeListTemplateColumn DataField="Item" UniqueName="TemplateColumn">
           <ItemTemplate>
             <telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox1" Value='<%# Eval("Item") %>'>
             </telerik:RadNumericTextBox>
           </ItemTemplate>
        </telerik:TreeListTemplateColumn>
      </Columns>
    </telerik:RadTreeList>
    void Button1_Click(object sender, EventArgs e)
    {
       foreach (TreeListDataItem item in RadTreeList1.Items)
       {
           int? id = (int?)item.GetDataKeyValue("ID");
           double? value = (item["TemplateColumn"].FindControl("RadNumericTextBox1") as RadNumericTextBox).Value;
           // Update database record with ID equals to id.
       }
    }

    Additionally I am sending you a simple example. Please check it out and let me know if it helps you.

    Regards,
    Radoslav
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lucien
    Lucien avatar
    13 posts
    Member since:
    Nov 2010

    Posted 23 Jan 2011 Link to this post

    Hello Radoslav,

    sorry for the delay, i was in vacation.
    But hey, many thanx for the helpful example. I tried it once and it worked like a charm.

    After a few month trying RadControls for ASP.NET AJAX, we decided to buy it!
    Anyway we have a little concern:
    we need to check the values in each cell with javascript, to verify the amounts.

    Example:
    If A1 = 100, then A1.1 + A1.2 + A1.3 = 100 !
    A1        100
      A1.1    70
      A1.2    30
      A1.3    0

    You know what i mean, right?
    So will the next release have such a feature? If not, do you have a sample or demo example to achieve this?
    If yes, when will you release the next RadControls?
    Can i upgrade to this last version for free if i buy the actual version now?

    Thank you again for you time and help
    Lucien
  5. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 27 Jan 2011 Link to this post

    Hello Lucien,

    It’s good to hear that you’ve enjoyed working with our ASP.NET AJAX trial and that you are currently in the process of purchasing.

    Unfortunately we do not plan to include the desired functionality into the RadTreeList control. However you could try achieving it by getting all items on the client by using the TreeList.get_dataItems() function and then iterate over them. Every Item has hierarchical Index which contains two parts:
    - LevelIndex - indicates the index of the item into the level
    - NestedLevel - indicates to which level the item belongs

    More information about  you could find in this link:
    http://www.telerik.com/help/aspnet-ajax/treelist-understanding-structure.html

    So in your case you could iterate over all items and check if values in each cell from one level has the parent amount.

    To your last question, if you purchase a RadControls for ASP.NET AJAX Developer License with Subscription and Priority Support (999/developer), you  will be entitled to receive all version updates (major and minor) for the Software for a period of 1 year after the purchase. As part of this license you will be also entitled to a Priority Level Support (24h guaranteed response time, Mon-Fri). And last, but not least the subscription license grants access to the full C# and JavaScript source code.

    I hope the provided information is helpful. If you have any additional questions, please let me know.

    Kind regards,

    Radoslav
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top