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

Non requiered fields show "null" on Edit Mode

8 Answers 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 13 Sep 2010, 04:27 PM
Hi.

 My question is: How to avoid the "null" text on columns that are nullable?

Example: My model is:

[KnownType(typeof(ReferralViewModel))]
public class ReferralViewModel
{
    [ScaffoldColumn(false)]
    public int Id { get; set; }
 
    [ScaffoldColumn(false)]
    public int Rut { get; set; }

    [Required(ErrorMessage = "Campo obligatorio")]
    [DisplayName("Observación Actual")]
    [DataType(DataType.Text)]
    public string AtencionObservacion { get; set; }

    [DisplayName("Detalle Interconsulta")]
    [DataType(DataType.Text)]
    public string DetalleInterconsulta { get; set; }
}

As show, DetalleInterconsulta is not requiered, and the posible values are null, empty or an string. When the user leave blank the field and insert it the grid show the row good. But when the user click the Edit Button, the blank field show "null". If I see the BD, sometimes the field is save as string "null" (not the NULL value).

This happens with all fields that are not required and the type is string. I'm using the last version of Telerik (2010.2.825.235).

I attach images for view.

Thanks.

8 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 14 Sep 2010, 03:21 AM
Any solution plis?

Thanks.
0
Accepted
Hristo Germanov
Telerik team
answered on 15 Sep 2010, 08:19 AM
Hi Daniel,

This issue will be fixed with the next official release of Telerik ASP.NET MVC components. The workaround is to hook up to the OnEdit(...) event and set appropriate value for the TextBox(or other controls).

Best wishes,
Hristo Germanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Daniel
Top achievements
Rank 1
answered on 16 Sep 2010, 04:34 AM
Hristo.

Can you post a little example ofDataType.Text plis? (as show in the images).

Thanks.

0
Jigar
Top achievements
Rank 1
answered on 16 Sep 2010, 08:17 AM
Hi Daniel,

Please have a look at this; And go to the topic "Initializing editing controls in OnEdit"

This may help.

Thanks,

Jigar
0
Daniel
Top achievements
Rank 1
answered on 16 Sep 2010, 02:52 PM
@Hristo and @Jigar.

Thanks!
0
Erik
Top achievements
Rank 1
answered on 12 Oct 2010, 12:28 PM
Hi Hristo and Jigar,

Could you confirm whether this issue should be resolved in version 2010.2.902? I am using it and the issue is still present. I am using PopUp as my edit mode, if that makes any difference.

Best regards,

Erik
0
Hristo Germanov
Telerik team
answered on 12 Oct 2010, 12:52 PM
Hello Erik,

This issue is fixed in service pack version(2010.2.930) of Telerik APS.NET MVC components.

Best wishes,
Hristo Germanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Erik
Top achievements
Rank 1
answered on 12 Oct 2010, 12:56 PM
Hi Hristo,

Thank you very much for your prompt reply. I will download the 930 version as soon as I can then.

Best regards,

Erik
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Hristo Germanov
Telerik team
Jigar
Top achievements
Rank 1
Erik
Top achievements
Rank 1
Share this question
or