sub grid How to create and load the data in sub grid

How to create and Load the data in sub grid







<%@ Page Language=“C#” AutoEventWireup=“true” %>











Grid Demo







        



































































xml are here

<?xml version="1.0" standalone="yes"?>





THE IMPERIAL

Deco suite Inside facing

Cambodia

05/01/2008

INR

Breakfast Included

Special FIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/01/2008

INR

Breakfast Included

Special GIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/01/2008

INR

Room Only

Rack Rate

false

37000

37000

5000



Tentative Extra Bed.

0

0

0



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/02/2008

INR

Breakfast Included

Special FIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/02/2008

INR

Breakfast Included

Special GIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/02/2008

INR

Room Only

Rack Rate

false

37000

37000

5000



Tentative Extra Bed.

0

0

0



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/03/2008

INR

Breakfast Included

Special FIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/03/2008

INR

Breakfast Included

Special GIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/03/2008

INR

Room Only

Rack Rate

false

37000

37000

5000



Tentative Extra Bed.

0

0

0



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/04/2008

INR

Breakfast Included

Special FIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/01/2008

INR

Breakfast Included

Special FIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/01/2008

INR

Breakfast Included

Special GIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/01/2008

INR

Room Only

Rack Rate

false

37000

37000

5000



Tentative Extra Bed.

0

0

0



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/02/2008

INR

Breakfast Included

Special FIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/02/2008

INR

Breakfast Included

Special GIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/02/2008

INR

Room Only

Rack Rate

false

37000

37000

5000



Tentative Extra Bed.

0

0

0



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/03/2008

INR

Breakfast Included

Special FIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/03/2008

INR

Breakfast Included

Special GIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/03/2008

INR

Room Only

Rack Rate

false

37000

37000

5000



Tentative Extra Bed.

0

0

0



12.5

8







THE IMPERIAL

Deco suite Inside facing

Cambodia

05/04/2008

INR

Breakfast Included

Special FIT

false

24125

24125

5000



Tentative Extra Bed.

1041

1659

1659



12.5

8





If you are overriding sub-grid creating logic you need to specify configuration of subgrid
It can be created in two ways

a) you can add code to the onSubGridCreated event
mygrid.attachEvent(“onSubGridCreated”,function(subgrid,id,index,data)
{ //data - data from related XML cell
alert(‘fun’);
subgrid.setHeader(…);
subgrid.setInitWidths(…)
subgrid.init();

subgrid.loadXMLString(“grid.xml”);
subgrid.callEvent(“onGridReconstructed”,[]);
return false;//block default logic
});

or



b) you can add configuration XML inside grid.xml
<?xml version="1.0" standalone="yes"?>


<column …


THE IMPERIAL