This is a migrated thread and some comments may be shown as answers.

[Solved] Passing text box id to Radwindow

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Babul Sahu
Top achievements
Rank 1
Babul Sahu asked on 29 Oct 2009, 04:18 PM
Hi,
  I have a entry grid I have 10 rows on which 10 radtext box is there and 10 corresponding image.
On clock of image I want to open Radwindow and get some values from Radwindow and fill in the corresponding text box.
I can get data grom Radwindow but problem is assigning data to respective text box.
How can I get ID of text box to assign data?

With Regards,
Babul

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Oct 2009, 06:43 AM
Hi Babul Sahu,

One suggestion is to save the index of clicked row in a HiddenField/variable when opening the window. And when closing the window, access the corresponding row/dataitem (using the index) from clientside and get reference to the RadTextBox using findControl() method in order to set the value.

Here is the code for accessing textbox placed in first row.
javscript:
 
<script type="text/javascript"
    function accessTextBox() { 
        var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); 
        var textbox = masterTable.get_dataItems()[0].findControl("RadTextBox1"); // RadTextBox1 is placed in ItemTemplate of GridTemplateColumn 
    } 
</script> 

-Shinu.
Tags
Grid
Asked by
Babul Sahu
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or