Welcome Guest Search | Active Topics | Sign In | Register

GridView/ClientSideEndEdit/GetValue Problem Options
Red mist
Posted: Friday, January 28, 2011 7:24:13 AM
Rank: Newbie
Groups: Member

Joined: 1/28/2011
Posts: 6
Hi all,

I'm trying to get the value from a Grid View when a user is done with editing. Basically, the user enters a value and press enter. Then the "ClientSideEndEdit" Javascript code will be invoked. All I get from the alert is "undefined".

My Javascript looks like that:
<script type="text/javascript">

function on_end_edit(cell) {

//Get the current cell value
var value = cell.getValue();
alert(value);
}
</script>

Grid View:

</eo:TextBoxColumn>
<eo:TextBoxColumn DataField="myDataField" HeaderText="Header Text" ClientSideEndEdit="on_end_edit" AllowResize="False" AllowSort="True" DataFormat="">

Many thanks
eo_support
Posted: Friday, January 28, 2011 8:55:22 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Check the data in your data source. It will be "undefined" if it is a null value, or an empty string value. It can also be undefined if you have edited it once and cleared the data (in which case it became an empty string and then became "undefined").

Thanks!
Red mist
Posted: Friday, January 28, 2011 11:14:43 AM
Rank: Newbie
Groups: Member

Joined: 1/28/2011
Posts: 6
Thank you for your quick reply!

Unfortunately I still have the problem. What I'm trying next is to use a MaskedTextBox.

thanks,
eo_support
Posted: Friday, January 28, 2011 11:22:37 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

That will not fix the problem for you. The Grid code you posted above is correct and we do not see anything wrong on the Grid regarding this either. So most likely the root of the problem is either in your data source or somewhere in your code.

Or you can also say it's a problem only if you call it a problem because "undefined" is a valid situation which represents an empty cell. If that is a possible situation based on your business/data logic, then you should just handle it properly instead of trying to get rid of it.

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.