2
Answers

Retrieve data Grideview when SelectedIndexChanged

ToBe

ToBe

12y
1.3k
1
Hi everybody 

I have dropdown list contain all the University inserted in my database and I want when the event SelectedIndexChanged clicked  to show  a grideview contain data related to the selected item  I created the gridview and I wrote this code when SelectedIndexChanged 

  protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
        {

            string Grdvw = GridView1.Visible.ToString();
                  
                
        }
Answers (2)
0
Vulpes

Vulpes

NA 98.3k 1.5m 12y
You can get a string array containing the 6 attribute values using LINQ to XML as follows:

using System.Linq;
using System.Xml.Linq;
using System.IO;

// ...

XElement root = XElement.Load("maha.xml");
string[] values = root.Element("Serial").Element("Current").Attributes().Select(a => 
a.Value).ToArray();

You should find that:

values[0] will contain : 11 March 2011
values[1] will contain : 10 Rabi-Ul-Awal 1434

and so on.

It's then just a matter of assigning the appropriate values to your textblocks.