Click here to Skip to main content
11,576,293 members (63,076 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET
protected void gv1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        tb.Text = gv1.Rows[e.NewSelectedIndex].Cells[2].Text;
        tb1.Text = gv1.Rows[e.NewSelectedIndex].Cells[3].Text;
 IEnumerable<datarow> m = (from x in BAL.INSTANCE.disempdetails().AsEnumerable() where x.EID == Convert.ToInt32(gv1.Rows[e.NewSelectedIndex].Cells[2].Text) select new { x.DID, x.DNAME });</datarow>
        DataTable dt1 = new DataTable();
        dt1.Columns.Add("DID", typeof(string));
        dt1.Columns.Add("DNAME", typeof(string));
        m.CopyToDataTable(dt1, System.Data.LoadOption.PreserveChanges);
        gv.DataSource = m;
        ViewState["i"] = 1;
Posted 25-Apr-13 21:53pm
Edited 25-Apr-13 22:13pm
(no name)186.5K
Naz_Firdouse at 26-Apr-13 4:02am
what is happening with this code???
Explain the issues...
Francisco T. Chavez at 26-Apr-13 18:38pm
Why don't you just loop through the list and add the each item to the table?
chien.vh at 4-May-13 14:13pm
For your reference:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 271
1 F-ES Sitecore 140
2 Abhinav S 135
3 Lucifier Rocks 105
4 Dave Kreskowiak 80
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 626
2 Abhinav S 483
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 26 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100