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

Client-Side OnColumnCreated

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Himmet
Top achievements
Rank 1
Himmet asked on 27 Feb 2009, 03:22 PM
we have a multi language project, so i need to set the columns headertext dynamicaly.

So what is the problem.
I cannot use server-side oncolumncreated because i am using client-side databinding with paging. I wrote a script like this for the client-side event.
My question is: How can i assign the text for rowheader ?
I used this column.get_parent().headerRow but i know this isnt the right one, and i couldnt found the correct one. If someone can give an answer for this i will be happy.

Regards...

function ColumnCreated(sender, eventArgs) 
    { 
        var column = eventArgs.get_column(); 
 
        if (column.get_dataField() == "RET_CODE"
             column.get_parent().headerRow = '<%= Messages.GetMessage(1112) %>'
        if (column.get_dataField() == "RET_DELIVERYNAME"
            column.get_parent().headerRow = '<%= Messages.GetMessage(1442) %>'
        if (column.get_dataField() == "RET_DELIVERY_ADDRESS"
            column.get_parent().headerRow = '<%= Messages.GetMessage(1398) %>'
        if (column.get_dataField() == "RET_CONTACTNAME"
            column.get_parent().headerRow = '<%= Messages.GetMessage(1029) %>'
        if (column.get_dataField() == "RET_PHONE"
            column.get_parent().headerRow = '<%= Messages.GetMessage(1031) %>'
        if (column.get_dataField() == "CL_STATUS"
            column.set_visible(false); 
    } 

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 03 Mar 2009, 09:41 AM
Hi Himmet,

You can use this method to alter the text in the header item, and any given cell.
I hope this suggestion helps.

Kind regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Himmet
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or