本文介绍了在gridview中获取Boundfield的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii朋友..i在.aspx页面上编写了以下代码...现在,我想在.cs代码上为该边界字段提供值/id..plz帮助我..谢谢..

Hii friends..i have written following code on my .aspx page...now 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" />
                                        </asp:BoundField 

推荐答案

string value = dtgDetail.Rows[RowIndex].Cells[BoundFieldIndex].Text;
/* Here 
   dtgDetail = your GridView
   RowIndex = your desired row index 
   BoundFieldIndex = your desired field index. */



这篇关于在gridview中获取Boundfield的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 09:39