Hi,
I'm using Telerik GridView. I have an issue regarding data binding in GridView. according to my requirement I have a Stored Procedure i my database and it returning me datas and i need to bind that data in GridView bt my problem is that i don't have any fix columns. my columns name changes according to month and also columns counter change so i can't bind columns. so resolving this i created xdocument and fill all datas in it and columns name.
here is my xDocument.
<?xml version="1.0" encoding="utf-8" ?>
<ROOT>
<ITEM HIDE_M_SYS_CD_ITEM="70" ITEM_CATEGORY=">50 HP" ITEM_NAME="0252PY01(0252PY01)" _29-Aug-2011="2" _19-Sep-2011="2" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="32" ITEM_CATEGORY="41-50 HP" ITEM_NAME="0095PY02(0095PY02)" _29-Aug-2011="1" _05-Sep-2011="3" _12-Sep-2011="4" _19-Sep-2011="4" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="32" ITEM_CATEGORY="41-50 HP" ITEM_NAME="0095PY02(0095PY02)" _29-Aug-2011="1" _05-Sep-2011="3" _12-Sep-2011="4" _19-Sep-2011="4" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="73" ITEM_CATEGORY=">50 HP" ITEM_NAME="0251PY25(0251PY25)" _05-Sep-2011="2" _12-Sep-2011="1" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="73" ITEM_CATEGORY=">50 HP" ITEM_NAME="0251PY25(0251PY25)" _05-Sep-2011="2" _12-Sep-2011="1" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="32" ITEM_CATEGORY="41-50 HP" ITEM_NAME="0095PY02(0095PY02)" _29-Aug-2011="1" _05-Sep-2011="3" _12-Sep-2011="4" _19-Sep-2011="4" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="32" ITEM_CATEGORY="41-50 HP" ITEM_NAME="0095PY02(0095PY02)" _29-Aug-2011="1" _05-Sep-2011="3" _12-Sep-2011="4" _19-Sep-2011="4" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="70" ITEM_CATEGORY=">50 HP" ITEM_NAME="0252PY01(0252PY01)" _29-Aug-2011="2" _19-Sep-2011="2" ></ITEM>
</ROOT>
for grid view binding i used this code:-
var Procurments = (from obj_PIS in xmlContent.Descendants("ITEM")
select obj_PIS).ToList();
objProcurementPlan.rdGridViewProcurements.ItemsSource = Procurments;
in above xDocument attribute in item node change according to my parameter.
but its not working i didn't get expected result. So how can i use this xml document as itemsource in grid view.
I'm using Telerik GridView. I have an issue regarding data binding in GridView. according to my requirement I have a Stored Procedure i my database and it returning me datas and i need to bind that data in GridView bt my problem is that i don't have any fix columns. my columns name changes according to month and also columns counter change so i can't bind columns. so resolving this i created xdocument and fill all datas in it and columns name.
here is my xDocument.
<?xml version="1.0" encoding="utf-8" ?>
<ROOT>
<ITEM HIDE_M_SYS_CD_ITEM="70" ITEM_CATEGORY=">50 HP" ITEM_NAME="0252PY01(0252PY01)" _29-Aug-2011="2" _19-Sep-2011="2" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="32" ITEM_CATEGORY="41-50 HP" ITEM_NAME="0095PY02(0095PY02)" _29-Aug-2011="1" _05-Sep-2011="3" _12-Sep-2011="4" _19-Sep-2011="4" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="32" ITEM_CATEGORY="41-50 HP" ITEM_NAME="0095PY02(0095PY02)" _29-Aug-2011="1" _05-Sep-2011="3" _12-Sep-2011="4" _19-Sep-2011="4" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="73" ITEM_CATEGORY=">50 HP" ITEM_NAME="0251PY25(0251PY25)" _05-Sep-2011="2" _12-Sep-2011="1" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="73" ITEM_CATEGORY=">50 HP" ITEM_NAME="0251PY25(0251PY25)" _05-Sep-2011="2" _12-Sep-2011="1" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="32" ITEM_CATEGORY="41-50 HP" ITEM_NAME="0095PY02(0095PY02)" _29-Aug-2011="1" _05-Sep-2011="3" _12-Sep-2011="4" _19-Sep-2011="4" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="32" ITEM_CATEGORY="41-50 HP" ITEM_NAME="0095PY02(0095PY02)" _29-Aug-2011="1" _05-Sep-2011="3" _12-Sep-2011="4" _19-Sep-2011="4" ></ITEM>
<ITEM HIDE_M_SYS_CD_ITEM="70" ITEM_CATEGORY=">50 HP" ITEM_NAME="0252PY01(0252PY01)" _29-Aug-2011="2" _19-Sep-2011="2" ></ITEM>
</ROOT>
for grid view binding i used this code:-
var Procurments = (from obj_PIS in xmlContent.Descendants("ITEM")
select obj_PIS).ToList();
objProcurementPlan.rdGridViewProcurements.ItemsSource = Procurments;
in above xDocument attribute in item node change according to my parameter.
but its not working i didn't get expected result. So how can i use this xml document as itemsource in grid view.