WebDataGrid设置某行某列的值

时间:2022-04-10 05:13:34

<ig:WebDataGrid ID="grid"  OnRowSelectionChanged="grid_RowSelectionChanged" OnPageIndexChanged="grid_PageIndexChanged"  runat="server"  DefaultColumnWidth="100px">

【OnRowSelectionChanged WebDataGrid选中行改变】

for (int i = 0; i < grid.Rows.Count; i++)
   {
            string name=grid.Rows[i].Items[3].Text;
            if (name == "1")
            {
                grid.Rows[i].Items[3].Text = "Tom";
            }
            else
            {
                grid.Rows[i].Items[3].Text = "Jack";  
            }
        }