This is a migrated thread and some comments may be shown as answers.

Null value in args.get_gridDataItem()

4 Answers 232 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lubna Ansari
Top achievements
Rank 1
Lubna Ansari asked on 03 Mar 2010, 11:28 AM
Hi,

I am working with Rad gird Client-side Insert/Update/Delete. I'm referring the demo code.

I'm getting a null vlaue error for args.get_gridDataItem() when i select a row

 

Here is your code

 

function

 

rowSelected(sender, args)

 

{

 

//controlID = args.getDataKeyValue("ControlID");
Id = getDataItemKeyValue(sender,args.get_gridDataItem());

 

currentRowIndex = args.get_gridDataItem().get_element().rowIndex;

 

$find(

"<%= RadTabStrip1.ClientID %>").set_selectedIndex(0);

 

 

GetControlByControlID(controlID, setValues)

 

}

Whts the problem??

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Mar 2010, 12:03 PM
Hello Lubna,

The get_gridDataItem() is not directly available on the client unless OnRowCreating/OnRowCreated events are hooked up. Try adding OnRowCreating/OnRowCreated events as shown below and see whether it works.

aspx:
 
</MasterTableView> 
<ClientSettings> 
    <ClientEvents OnRowSelected="RowSelected" OnRowCreated="OnRowCreated" 
        OnRowCreating="OnRowCreating" /> 
   . . . 

javascript:
 
    function OnRowSelected(sender, eventArgs) { } 
    function OnRowSelecting(sender, eventArgs) { } 
    function RowSelected(sender, eventArgs) { 
        var item = eventArgs.get_gridDataItem(); 
         . . . 
    } 

Regards,
Shinu.
0
Lubna Ansari
Top achievements
Rank 1
answered on 03 Mar 2010, 12:23 PM
Thnxs Shinu
It worked
0
Lubna Ansari
Top achievements
Rank 1
answered on 03 Mar 2010, 02:39 PM
Hi,

I need to use Rad gird Client-side Insert/Update/Delete. In the demo code provided it is using webservice for all databse related operation. Can somebody send me the code with using simple database queries. I got stuck with

HttpContext.

 

Current.Session["MyData"]  
when doing without websrvices.

 

 

 

 

 

 

 

 

0
Accepted
Tsvetoslav
Telerik team
answered on 05 Mar 2010, 12:26 PM
Hi Lubna,

Attached is a small sample.

Regards,
Tsvetoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Lubna Ansari
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Lubna Ansari
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or