DataGrid Control

A

Aziz

Hi,

I have a Datagrid Control, where I have a template column
in which I have a textbox control which is in the
EditItemTemplate. In the edit mode I can see the textbox
control. I have a search image next to the textbox
control. On clicking the image a new pop-up window is
shown wherein a user can search for a value. This value
has to be then transferred to the textbox which is in the
DataGrid control. I have tried out doing this but without
any success.
One more thing is that the page should not be refreshed
when you transfer the value from the pop-up window to the
textbox in the DataGrid control.

Can anyone suggest some solution.

Thanks in advance,
Aziz.
 
R

Ravikanth[MVP]

Hi

After reading your question I understood that you are
able to succeed upto opening new window.

where we need tis o emit client-side JavaScript code to
update the form and close the pop-up. While we could
simply use Response.Write's, the output would appear
before any other HTML content (including the <html> tag).
So, to make our HTML "correct," we'll use a literal
control inbetween the <head> ... </head> tags. Creating
this literal control is easy enough:

<head>
<asp:Literal id="Literal1"
runat="server"></asp:Literal>
</head>


We will use this literal control to hold our JavaScript
after we create it. Now lets look at creating the
JavaScript to pass the value back to the form. The first
thing we will do is create a string, strJScript, to hold
our JavaScript code. Next, we will build up this string
so that it's end contents set the form's text box's value
to the selected date and the window is closed. This is
accomplished with the following code

Private Sub Button_Click(sender As Object, e As EventArgs)
Dim strjscript as string = "<script
language=""javascript"">"
strjscript &= "window.opener." & _
Httpcontext.Current.Request.Querystring
("formname") & ".value = '" & _
Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</script" & ">" 'Don't Ask,
Tool Bug

Literal1.Text = strjscript 'Set the literal control's
text to the JScript code
End Sub





For further check the following link. which shows how to
pop up form inputs using calendar control.

http://aspnet.4guysfromrolla.com/articles/030202-1.aspx

HTH
Ravikanth[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top