Hello everybody,
I have a problem : I hava an XML File like this one :
What I want is to obtain a RadGrid constructed with the same hierarchy.
The code I use now is :
The problem is that the hierarchy is well respected (see the picture in attached files) BUT RadGrid add "IDs" columns automatically...
1) What can I do to hide these ID Columns that are not presents in my XML File ?
2) Can I add an empty textbox for each Product Row in the end of each line ? How ?
Thanks a lot for your help :)
I have a problem : I hava an XML File like this one :
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
Catalog
>
<
Family
Name
=
"Family1"
>
<
SubFamily
Name
=
"List1"
>
<
Product
Name
=
"Product1"
Packaging
=
"5"
></
Product
>
<
Product
Name
=
"Product2"
Packaging
=
"5"
></
Product
>
<
Product
Name
=
"Product3"
Packaging
=
"25"
></
Product
>
</
SubFamily
>
<
SubFamily
Name
=
"List2"
>
<
Product
Name
=
"Product1"
Packaging
=
"25"
></
Product
>
</
SubFamily
>
</
Family
>
<
Family
Name
=
"Family2"
>
<
SubFamily
Name
=
"List1"
>
<
Product
Name
=
"Product1"
Packaging
=
"10"
></
Product
>
<
Product
Name
=
"Product2"
Packaging
=
"10"
></
Product
>
</
SubFamily
>
<
SubFamily
Name
=
"List2"
>
<
Product
Name
=
"Product1"
Packaging
=
"10"
></
Product
>
</
SubFamily
>
</
Family
>
</
Catalog
>
What I want is to obtain a RadGrid constructed with the same hierarchy.
The code I use now is :
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
Skin
=
"Web20"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
AutoGenerateHierarchy
=
"True"
>
<
MasterTableView
HierarchyDefaultExpanded
=
"True"
>
<
Columns
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
public
void
RadGrid1_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = GetHierarchicalXmlData();
}
private
DataSet XMLDataSet;
private
DataSet GetHierarchicalXmlData()
{
XMLDataSet =
new
DataSet();
XmlTextReader reader =
new
XmlTextReader(myfilename);
// myfilename is the fullpath for the xml file
XMLDataSet.ReadXml(reader);
return
XMLDataSet;
}
The problem is that the hierarchy is well respected (see the picture in attached files) BUT RadGrid add "IDs" columns automatically...
1) What can I do to hide these ID Columns that are not presents in my XML File ?
2) Can I add an empty textbox for each Product Row in the end of each line ? How ?
Thanks a lot for your help :)