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

[Solved] client-side data-binding gridbuttoncolumn

2 Answers 245 Views
Grid
This is a migrated thread and some comments may be shown as answers.
M van der Kolk
Top achievements
Rank 1
M van der Kolk asked on 12 Nov 2009, 02:24 PM
I've successfully created a radgrid which uses client-side data-binding. In this radgrid I have one databoundcolumn:
<telerik:GridBoundColumn DataField="FullName" HeaderText="FullName"  
    SortExpression="FullName" UniqueName="FullName"
</telerik:GridBoundColumn> 
 

I would like to add more types of column in this radgrid, for instance a gridbuttoncolumn. However, when I try this code:
<telerik:GridButtonColumn HeaderText="FullName" DataTextField="FullName"  
            Text="FullName" DataType="System.String" UniqueName="FullName"></telerik:GridButtonColumn> 
 

the column is always empty.
Can someone tell me how to add other column types using client-side data-binding?

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 13 Nov 2009, 03:46 PM
Hello M van der Kolk,

We are aware of this issue and fix will be available officially for next service pack of RadControls for ASP.NET AJAX. Currently you can manually find the button on RowDataBound client event and populate it.

Best wishes,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
M van der Kolk
Top achievements
Rank 1
answered on 13 Nov 2009, 03:51 PM
Thank you for your reply.

I have implemented the RowDataBound event like this:
function grid_RowDataBound(sender, args) 
    var hyperlink = args.get_item().get_cell("FullName").getElementsByTagName('a')[0]; 
    hyperlink.innerText = args.get_dataItem()['FullName']; 
    hyperlink.onclick = function(){  
        hiddenGuid.value = args.get_dataItem()['PersonId']; 
        return true
    } 
 

Tags
Grid
Asked by
M van der Kolk
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
M van der Kolk
Top achievements
Rank 1
Share this question
or