| |

VerySource

 Forgot password?
 Register
Search
View: 909|Reply: 8

Masters, please come in and help !!!

[Copy link]

2

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-2-2 12:40:01
| Show all posts |Read mode
This can be controlled in the page .cs,
((TextBox) this.GridView1.Rows [0] .FindControl ("company")). Text = "fdafdas";

But now you need to set the relevant properties of window.opener. In the pop-up new window, set the _RowDataBound in the pop-up new window, but no, how to write
e.Row.Attributes.Add ("ondblClick", "window.opener.document.all.GridView1.Rows [0] .cells [0] .company.value = 'fdafdas'; window.close ();");
Reply

Use magic Report

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-3-20 17:30:01
| Show all posts
TextBox t1 = ((TextBox) this.GridView1.Rows [0] .FindControl ("company"));
e.Item.Attributes.Add ("ondblClick", "window.opener.document.getElementById ('" + t1.ClientID + "'). value = 'fffff';");
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-3-20 18:00:02
| Show all posts
window.opener.document.all.GridView1.rows [0] .cells [0] .firstChild.value = 'aaaa';

If the textbox is the first element of cells [0]. The other rows should be lowercase.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-3-22 15:30:01
| Show all posts
I just watched another post from you.

-------------------------------------------------- ---------------------
What is needed is this effect, the TEXTBOX control positioned in the row is assigned, but the above method does not work


To be sure, the first element in the first row and column is the TextBox

But the first line is impossible, the first line is the header.
Reply

Use magic Report

3

Threads

26

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-3-23 10:15:01
| Show all posts
window.opener.document.all.GridView1.rows [0] .cells [0] .firstChild.value = 'aaaa';
Reply

Use magic Report

2

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-3-24 00:45:02
| Show all posts
shenmue024

Mine is the first row, the first column, yes

But window.opener.document.all.GridView1.rows [0] .cells [0] .firstChild.value = 'aaaa';
No way

window.opener.document.all. Are you sure you can control the rows and columns in GRIDVIEW? ? ?
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-3-24 13:45:01
| Show all posts
Yes. If you do n’t cross domains, you can.
Does your gridview have no title?

rows [0] generally refers to the header row.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-3-24 14:30:01
| Show all posts
Can you post the html code generated by the gridview client?
Reply

Use magic Report

2

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-3-26 02:30:01
| Show all posts
<input name = "GridView1 $ ctl02 $ company" type = "text" value = "" onchange = "javascript: setTimeout ('__ doPostBack (\'GridView1 $ ctl02 $ company\',\'\')', 0)" onkeypress = "if (WebForm_TextBoxKeyHandler (event) == false) return false;" id = "GridView1_ctl02_company" disabled = "disabled" style = "width: 200px;" />

Through the client's window.opener.document.all.GridView1_ctl02_company.value = 'testdata'; can be assigned, but the data will be lost when I add a new one

My GRIDVIEW is generated automatically.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list