How to get radgrid's template column value from javascript

9 posts, 0 answers
  1. Vaibhav
    Vaibhav avatar
    33 posts
    Member since:
    Dec 2007

    Posted 21 Oct 2008 Link to this post

    Hi,

    I have to store a value that I don't want to show to user.
    I have template column like:

     <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:HiddenField ID="hddesc" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.description") %>' />
                            </ItemTemplate>
    </telerik:GridTemplateColumn>

    How to get its value from javascript?

    Thanks,
    Vaibhav



  2. Vaibhav
    Vaibhav avatar
    33 posts
    Member since:
    Dec 2007

    Posted 21 Oct 2008 Link to this post

    Hi,

    I solved my problem by using boundcolumn and setting it's display property to false.

    Regards,
    Vaibhav
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Prakash Jothi
    Prakash Jothi avatar
    6 posts
    Member since:
    Sep 2007

    Posted 19 Jan 2009 Link to this post

    Hi,

    I am facing same problem, I am using a TemplateColumn in Grid and want to extract value from it.

    I can not switch to bound column because placing a custom control in to template column.

    Kindly provide a solution to get value from template column, As well how to do sorting on a template column where we are placing user control in this template column.

    Thanks,
    Prakash J
  5. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 19 Jan 2009 Link to this post

    Hello Prakash,

    There are two options to extract the value from the column on the client.
    First, you can reference the control via its clientId, and get the value.
    Alternatively, you can use this method to get a reference to the cell, and then access the childnodes collection, which would also offer access to the value in the column.
    I hope this information helps.

    Greetings,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. victor
    victor avatar
    3 posts
    Member since:
    Feb 2011

    Posted 29 Mar 2011 Link to this post

    Hi,

    I have a RadTreeView nested in a RadComboBox which is in a RadGrid(GridTemplateColumn). How can I get the selected node value thru client side script? I cant manage to set the text for the combobox after selecting the node value from the treeview. I'd appreciate your help. Thanks in advance!

    Victor
  7. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 29 Mar 2011 Link to this post

    Hello victor,

    The implementation from this demo can help you achieve what you need (see the Employee name column editor).

    Best regards,
    Sebastian
    the Telerik team
  8. victor
    victor avatar
    3 posts
    Member since:
    Feb 2011

    Posted 30 Mar 2011 Link to this post

    Hi Sebastian,

    Thank you for your quick reply! The example has resolved my issue.
  9. victor
    victor avatar
    3 posts
    Member since:
    Feb 2011

    Posted 31 Mar 2011 Link to this post

    Hi Sebastain,

    I have another question regarding the radcombo box selected value on editmode=popup dialog. How do I change this to display a different value? I am using a linqdatasource that is only referencing 1 table (Order table). Order table has foreign key of Product ID but I need to display in the popup the Product name form the Product table. Please note I am using the automatic update from radgrid.

    I tried placing Text='<%# Eval("Stakeholder.StakeholderName") %>'> but no good. Appreciate your help again!
     

    ...
    <

     

     

    telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="Product" Visible="false"

     

        SortExpression="Product.ProductName">

        <EditItemTemplate>

     

            <telerik:RadComboBox ID="rcbParentStakeholder1" runat="server" Skin="Telerik"

                Width="255px" OnClientDropDownOpened="OnClientDropDownOpenedHandler"

     

     

                Text='<%# Eval("Stakeholder.StakeholderName") %>'>
    ...

     

     

  10. Kiara
    Kiara avatar
    309 posts
    Member since:
    Jul 2006

    Posted 31 Mar 2011 Link to this post

    Try to set different data source for the combobox (using its DataSourceID property and specify DataTextField/DataValueField too) which points to the Product table. Also for automatic operations use two-way binding with Bind expression (instead of Eval) for the SelectedValue property of the combo, not its Text property.

    One more thing - the data source of the combo should be configured to trigger update of the ProductID field in the Orders table. This should be done with your own code as trigger.

    Kiara
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017