Datagrid (clientside) attributes for selectedindex...

J

Julius Fenata

Dear all,

I'm trying to create a browser handler using window.showmodaldialog.
I have one textbox (aspnet control) and find button (HTML input-button), and
when I pressed the find button from my base form, it would call form browser
like this:

ASPX-PAGE
=======
<script language="javascript">
function OpenChild()
{
var Param = document.getElementById("txt_vInventoryID").value;
var WinSettings =
"center:yes;resizable:yes;dialogHeight:600px;dialogWidth:900px"
var MyArgs = window.showModalDialog("Browser.aspx", Param, WinSettings);

if (MyArgs == Param)
{
window.alert("Nothing returned from child. No changes made to input
boxes")
}
else
{
document.getElementById("txt_vInventoryID").value = MyArgs.toString();
}
}
</script>

My form browser contains datagrid, and when I selected the datagrid I
expected that it will automatically closed the browser form and post the
information of the record selected (like:
datagrid.SelectedItem.Cells[0].Text;) to the textbox on my base form.

CODE-BEHIND
=========
private void dg_SelectedIndexChanged(object sender, System.EventArgs e)
{
string myVar = dg.SelectedItem.Cells[0].Text;

string myScript = @"<script>
function Done()
{
window.returnValue = %01;
window.close();
}
</script>;";

myScript = myScript.Replace("%01", myVar);

Page.RegisterClientScriptBlock("done", myScript);
}

But this code cannot run, how to make this scenario run?
How to create datagrid.selectedindex triggering client-script function and
send the information regarding selected record?

Please help,


Julius Fenata
 

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

Forum statistics

Threads
473,780
Messages
2,569,607
Members
45,240
Latest member
pashute

Latest Threads

Top