This is a migrated thread and some comments may be shown as answers.

XML IN RAD filter

2 Answers 50 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
KIRAN RAJ
Top achievements
Rank 1
KIRAN RAJ asked on 25 Sep 2011, 12:07 PM
Hi guys,
Is there any way with which i can have XML values as fields into rad filter..? 

Thanks In advance..!!!

2 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 28 Sep 2011, 02:56 PM
Hello Kiran Raj,

Based on the supplied information, I am unable to fully understand the question.
Could you please elaborate more on your scenario?
What do you mean by XML values? What is the data source you want to filter?

All the best,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
KIRAN RAJ
Top achievements
Rank 1
answered on 28 Sep 2011, 10:59 PM
HI, Mira,
Thanks,  My question was How can we take data from XML and put it as filter fields in the RadFilter...
i was able to do that...by using
protected void Page_Init(object sender, EventArgs e)
  {
      
      string myypath = Server.MapPath("XMLFile.xml");
 
      DataSet ds1 = new DataSet();
      DataTable dt = new DataTable();
      // try
      {
          ds1.ReadXml(myypath);
          dt = ds1.Tables[0];
          foreach (DataRow aRow in dt.Rows)
          {
           if (!IsPostBack)
              {
                  RadFilterTextFieldEditor editor = new RadFilterTextFieldEditor();
                  RadFilter1.FieldEditors.Add(editor);
 
                  editor.DisplayName = (string)aRow["DisplayName"];
                  editor.FieldName = (string)aRow["FieldName"];
                  editor.DataType = typeof(string);
 
              }
          }
      }
 
  }
my xml file is: 
<FieldTextEditor>
   <editor1>
    <FieldName>Field1</FieldName>
    <DisplayName>field1</DisplayName>
    <DataType>typeof(string)</DataType>
    </editor1
  <editor1>
    <FieldName>field2</FieldName>
    <DisplayName>field2</DisplayName>
    <DataType>typeof(string)</DataType>
  </editor1>
    
</FieldTextEditor>
Tags
Ajax
Asked by
KIRAN RAJ
Top achievements
Rank 1
Answers by
Mira
Telerik team
KIRAN RAJ
Top achievements
Rank 1
Share this question
or