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

GetCellByColumnUniqueName error

4 Answers 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
prayag ganoje
Top achievements
Rank 1
prayag ganoje asked on 22 Jul 2010, 08:26 PM
Hello,

I using Telerik Grid control to display data on the ASP.net page. I need a value from selected row. So i used the following clint side API:

GetCellByColumnUniqueName

But while running the program it throws incompatibility error. see the error pop up attached. Can you please tell why this error is comming up ? How to get it resolved.


Thanks,
Prayag

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Jul 2010, 08:54 PM
Hello Prayag,

Can you please post your JS code here? In the meantime I suggest that you take a look at the following links:
Getting cell values for selected rows client side
getCellByColumnUniqueName

Regards,
Daniel
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
0
prayag ganoje
Top achievements
Rank 1
answered on 22 Jul 2010, 10:06 PM
Thank you for the reply. Here is the code added for the GridControl to invoke the client side function.

<clientsettings>
  <Selecting AllowRowSelect="true" />
  <ClientEvents OnGridCreated="GridCreated" OnRowSelected="RowSelected" />
</clientsettings>

Then the Javascript functions as follows :

function GridCreated() {
 grid = this;
}
function RowSelected(rowObject) {
 var selRow = this.GetCellByColumnUniqueName(rowObject, "AccountType");
 alert(selRow.innerHTML);
}


Here is "AccountType" a column unique name. I am also going through the links you have provided.
0
Accepted
Princy
Top achievements
Rank 2
answered on 23 Jul 2010, 08:35 AM
Hello Prayag,

The RowSelected event includes two parameters - sender and args. You can access the rowObject from the selectedItems collection of MasterTableView. Try the following code snippet to get the cell value of a selected row.

Java Script:
<script type="text/javascript">
    function RowSelected(sender, args)
    {
        var MasterTable = sender.get_masterTableView();
        var row = MasterTable.get_selectedItems()[0];  // Get the row object of selected item
        var selRow = MasterTable.getCellByColumnUniqueName(row, "AccountType");
        alert(selRow.innerHTML);
    }
</script>

Thanks,
Princy.
0
prayag ganoje
Top achievements
Rank 1
answered on 23 Jul 2010, 02:13 PM
Thanks Princy. It worked fine. Problem is solved.
Tags
Grid
Asked by
prayag ganoje
Top achievements
Rank 1
Answers by
Daniel
Telerik team
prayag ganoje
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or