Click here to Skip to main content
13,300,331 members (51,426 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hii friends..i have written following code on my .aspx i want value/id for this boundfield on my .cs code..plz help me..Thanks..

<asp:BoundField HeaderStyle-CssClass="grdheadermstertime"  DataField="fromdate" ReadOnly="true" HeaderText="From Date"  >
                                            <HeaderStyle CssClass="grdheadermstertime" />
                                            <ItemStyle CssClass="griditemstletime" />
Posted 16-Nov-12 2:28am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Simple you write this code any place where you want get your desired value...
string value = dtgDetail.Rows[RowIndex].Cells[BoundFieldIndex].Text;
/* Here 
   dtgDetail = your GridView
   RowIndex = your desired row index 
   BoundFieldIndex = your desired field index. */
remowo 18-Jul-17 4:05am
Be aware for this solution acquires visible ONLY cell text
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

use OnRowDataBound event to get the value for fromdate-field

see here[^]

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171207.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2017
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