try { String strText = e.Item.FindControl("控件的ID")).Text; } catch( Exception ex ) { //do nothing here... //Becase the first row of the column(header) do not have this control, so //you can not find it, and will course a exception ! or you can check if it' s not the header, then find control}
{
String strText = e.Item.FindControl("控件的ID")).Text;
}
catch( Exception ex )
{
//do nothing here...
//Becase the first row of the column(header) do not have this control, so
//you can not find it, and will course a exception ! or you can check if it' s not the header, then find control}
日月说的方法不行,DataGrid.Items[i].Cell[j].Control[0]后不能.Text了!~
int row = e.EditItemIndex;//不知道是不是 这个,你查一下帮助就知道了
string str = txt.Text;
e.Items[row][str];
ControlType a=(ControlType)DataGrid1.Item[i].FindControl("controlid");
string i=a.Text;