Welcome Guest Search | Active Topics | Sign In | Register

KeyField property Options
KarL
Posted: Monday, February 16, 2009 1:13:21 PM
Rank: Member
Groups: Member

Joined: 11/20/2008
Posts: 14
Hello,

I got an issue, I need to pass to other page the KeyFiel of the grid but im trying to do it by a javascript function. I got this function in my ClientSideOnItemCommand:

<script language="javascript" type="text/javascript">

function OnItemCommand(grid, itemIndex, colIndex, commandName)
{
var item = grid.getItem(itemIndex);
var Edicion = 'Edicion';
var NombreCompleto = item.getCell(1);
window.open('SegNvoEdicion.aspx?Tipo='+Edicion.valueOf() +'&Nm='+ NombreCompleto.getValue());

}

</script>

I cant take the keyfield by refering a cell in the grid because the keyfield is not a column in my grid I just call the column in the SELECT instruction of my SQLDataSource but is not shown on my grid. So i dont know if its posible to do this.

Please help, and thanks.

KarL
Posted: Monday, February 16, 2009 2:29:41 PM
Rank: Member
Groups: Member

Joined: 11/20/2008
Posts: 14
Hi,

I´d been trying with this:

<script language="javascript" type="text/javascript">

function OnItemCommand(grid, itemIndex, colIndex, commandName)
{
var item = grid.getItem(itemIndex);
//var cell = item.getCell(1);
var Edicion = 'Edicion';
var key= grid.getItem.getKey();
var NombreCompleto = item.getCell(1);
//window.open('SegNvoEdicion.aspx?Tipo='+Edicion.valueOf() +'&IdPlanilla='+ key.getValue());
window.alert(Edicion.valueOf()+', '+key.getValue());

}

</script>

When do Click in my button column to display the alert with the values i got this message error:
"Microsoft JScript runtime error: Object doesn't support this property or method"
and the line "var key= grid.getItem.getKey();" appears marked. I can´t find any reference for this issue. Please help.

Thanks.

KarL
Posted: Monday, February 16, 2009 2:39:48 PM
Rank: Member
Groups: Member

Joined: 11/20/2008
Posts: 14
Eurekaaa!!!!

Now it´s ok, if somone else its looking for this issue, the problem was me jejeje. Finally i solved it by changing the code like this:

<script language="javascript" type="text/javascript">

function OnItemCommand(grid, itemIndex, colIndex, commandName)
{
var item = grid.getItem(itemIndex);
var key= item.getKey();
window.alert(key.valueOf());

}

</script>

I hope this will be helpfull, Thanks :)


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.