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

Edit Form not being rendered when Grid Columns are changes programatically

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Onedemian
Top achievements
Rank 1
Onedemian asked on 08 Jul 2011, 08:32 PM
Hi!

I've just setup a RadGrid which formats a couple of date columns using a custom format which is retrieved from App.config, just like this in Page_Load ():

if (!IsPostBack)
{
    (RadGridConsulta.Columns.FindByUniqueName ("Creacion") as GridDateTimeColumn).DataFormatString = Audinet.Framework.Aplicacion.Configuracion["format.datetime.short"];
    (RadGridConsulta.Columns.FindByUniqueName ("Modificacion") as GridDateTimeColumn).DataFormatString = Audinet.Framework.Aplicacion.Configuracion["format.datetime.short"];
}


It just works when the list is generated, but when I click the Edit button, the Ajax is triggered but it finally does not render the edit form, returning  again to the general listing.

If I do remove that code, the Edit Form for a record is rendered. I am also setting ReadOnly="true" with no ColumnEditor property set, declaratively, for those date columns since they are auto-generated and need no edition, with no luck.

So, how can I set Column's properties programatically without affecting the display of the Edit Form?

Those are my column definitions:

<%-- Columna Creacion --%>
<telerik:GridDateTimeColumn DataField="Creacion" HeaderText="Creacion"
    UniqueName="Creacion" ReadOnly="true" SortExpression="Creacion" DataType="System.DateTime"
    HeaderStyle-Width="140px">
</telerik:GridDateTimeColumn>
 
<%-- Columna Modificacion --%>
<telerik:GridDateTimeColumn DataField="Modificacion" HeaderText="Modificacion"
    UniqueName="Modificacion" ReadOnly="true" SortExpression="Modificacion" DataType="System.DateTime"
    HeaderStyle-Width="140px" >
</telerik:GridDateTimeColumn>


Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 14 Jul 2011, 10:45 AM
Hi,

I assume that some exception is thrown when executing this code and it is hidden by ajax. Can you try temporatily switching AJAX off, so that you check whether any exceptions come up? Also, try referencing the columns of the mastertable - RadGridConsulta.MasterTableView.Columns...

Kind regards,
Tsvetina
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Onedemian
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or