Pregunta

Here's my try about JQGrid :

<JQ:JQGridColumn 
                DataField="ID" 
                PrimaryKey="true"
                DataType="int"
                HeaderText="NO" 
                Width="60" />
            <JQ:JQGridColumn 
                DataField="CustomerID.Name"
                DataType="String"
                HeaderText="Customer Name" 
                Width="100" />
            <JQ:JQGridColumn 
                DataField="CustomerID.Surname" 
                Searchable="false"
                DataType="String"
                HeaderText="Customer Surname 
                Width="100" />

And ObjectDataSource Class is :

public class Order
{
private int iD;
private Customer customerID;

public Customer CustomerID
        {
            get { return customerID; }
            set { customerID = value; }
        }

        public int ID
        {
            get { return iD; }
            set { iD = value; }
        }
}

And Customer class is like Order class. So when i try to this it's giving that error :

The column with DataField=CustomerID.Name does not exist in the datasource. (But it does)

How can i solve it ? Thanks.

¿Fue útil?

Solución

I've got the answer :

public string CustomerName
        {
            get { return CustomerID == null ? "" : CustomerID.Name; }
        }

If someone needs, use it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top