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

radgrid loosing textbox contents while sorting

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jukka
Top achievements
Rank 1
Jukka asked on 23 Jan 2009, 02:25 PM

Hi,

We have problems in loosing the text that is typed in a textbox of a radgrid as a result of sorting the grid (by the
standard column header links). The textbox is in the ItemTemplate of a GridTemplateColumn, and the contents
of the text box is not (due to various reasons) directly bound to a datasource. Product is Q3 2008.

We have tried setting in MasterTableView both the EnableColumnsViewState="true" EnableViewState="true",
but this did not resolve anything. Also, we have confirmed that the viewstate of the textbox is true
during the ItemDataBound (by doing the FindControl....), which is kicked in when the sorting links are clicked.

Grid is ajaxed with a RadAjaxManager.

Can anyone please shed some light on this and how to resolve this? Thanks.

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 27 Jan 2009, 07:08 AM
Hi Jukka,

When you perform sorting on RadGrid, the grid is being internally rebound. That is why the newly entered and unsaved text is lost. Therefore you need to save this text manually before sorting. And you could do it by handling the TextBox TextChanged event or by handling the SortCommand/ItemCommand.

Find more about RadGrid in the below online resources:
http://www.telerik.com/help/aspnet-ajax/grdeventsequence.html
http://www.telerik.com/help/aspnet-ajax/grdcommandsthatinvokerebindimplicitly.html
http://www.telerik.com/help/aspnet-ajax/grdapplycustomsortcriteria.html

Give it a try and let me know if further questions arise.

Best wishes,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Jukka
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or