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
445
Grid Attribute for columns
posted

Hi,

I'm using the infragistic grid and creating a generic grid. My problem now is to say to some class attributes to not show or to be hidden. Exemple:

- I have my model

public class CountryModel

{

public int CountryId { get; set; }

public string Code { get; set; }

public string Name { get; set; }

}

- I have my simple grid. Nothing to do here because it will show generically

@model GridModel

@(

Html.Infragistics().Grid("adm-generic-grid", Model)

)

- My datasource is can be a list of Country, Product or anything else. It is IQuerable<object>. So let's say it is something:

gridModel.DataSource = GetCountries();

GetCountries(){

return new List<Countryl>(){

new Country(){} ....

new Country(){} ....

}.AsQueryable()

}

- It works, I have my grid but I want to hide or show readonly some properties. Do you have some grid attributes for make it possible?

public class CountryModel

{

[GridColumn(Readonly=true, Hidden=true)]   ????

public int CountryId { get; set; }

[GridColumn(Readonly=true, Hidden=true)]   ????

public string Code { get; set; }

public string Name { get; set; }

}

Parents Reply Children
No Data