This is a migrated thread and some comments may be shown as answers.
How to get radgrid's template column value from javascript
8 Answers 202 Views
This is a migrated thread and some comments may be shown as answers.
Vaibhav
Top achievements
Rank 1
Vaibhav asked on 21 Oct 2008, 11:32 AM
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



8 Answers, 1 is accepted

Sort by
0
Vaibhav
Top achievements
Rank 1
answered on 21 Oct 2008, 12:36 PM
Hi,

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

Regards,
Vaibhav
0
Prakash Jothi
Top achievements
Rank 2
answered on 19 Jan 2009, 07:43 AM
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
0
Yavor
Telerik team
answered on 19 Jan 2009, 08:24 AM
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.
0
victor
Top achievements
Rank 1
answered on 29 Mar 2011, 11:49 AM
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
0
Sebastian
Telerik team
answered on 29 Mar 2011, 01:26 PM
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
0
victor
Top achievements
Rank 1
answered on 31 Mar 2011, 02:36 AM
Hi Sebastian,

Thank you for your quick reply! The example has resolved my issue.
0
victor
Top achievements
Rank 1
answered on 31 Mar 2011, 10:55 AM
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") %>'>
...

 

 

0
Kiara
Top achievements
Rank 1
answered on 31 Mar 2011, 11:23 AM
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
Tags
Grid
Asked by
Vaibhav
Top achievements
Rank 1
Answers by
Vaibhav
Top achievements
Rank 1
Prakash Jothi
Top achievements
Rank 2
Yavor
Telerik team
victor
Top achievements
Rank 1
Sebastian
Telerik team
Kiara
Top achievements
Rank 1
Share this question
or