Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
TemplatedColumn cleaning
posted

Hi,

I have a problem with TemplatedColumn. I am having a tree control and ultrawebgrid. If user clicks on a tree element, the grid is dynamically loaded with TemplatedColumn inside. The code looks like this:

uwg_Grid.ResetRows()
uwg_Grid.ResetColumns()
uwg_Grid.Clear()
uwg_Grid.Columns.Add(New Infragistics.WebUI.UltraWebGrid.UltraGridColumn("ID", "ID", Infragistics.WebUI.UltraWebGrid.ColumnType.NotSet, ""), True)
Dim col As New Infragistics.WebUI.UltraWebGrid.TemplatedColumn
col.Key = "template"
col.HeaderText = "Column"
col.CellTemplate = New PropertyTemplate(str_AssemblyName, str_NameSpace)

uwg_Grid.Columns.Insert(uwg_Grid.Bands(0).Columns.Count, col)

Inside  PropertyTemplate class I am implementing InstantiateIn method where I am adding new TextBox to the cells. The problem is that if you enter something into any textbox in that TemplatedColumn, and click another tree element the above code will run which should clear the webgrid and recreate it from the scratch with empty values in cells, but somehow the value you have entered still exists. Do I need to perform some additional clearing of the TemplatedColumn ?

Thanks in advance

Bartek

 

Parents
No Data
Reply
  • 45049
    posted

    I've seen a similar issue not that long ago, though it had to do with the filtering functionality of the grid when using a templated column.  The problem is that the ASP.NET TextBox has functionality to preserve its contents between postbacks, which is problematic when you have dynamic data.  It's hard to keep the data you want in the TextBox from being overwritten by this persistence functionality.

    Do you get the same behavior if you use an HTML TextBox (INPUT type="text"), whether it's a server element or not?

Children