Hi Rahi, I am not sure but this will give you some idea! 1.You can apply specific formatting to the data inside the cells using DataGrid rightclick>PropertyBuilder>Formatting>Items 2.You can add a hidden grid column say "Modified" and it's default value is "N".Now in DataGrid1_ItemDataBound you need to add clientside ontextchage eventhandler for desired cells Serverside:- private void DataGrid1_ItemDataBound(object sender,System.Web.UI.WebControls.DataGridItemEventArgs e) { //This code is for assigning userdefined Id's for rows and columns e.Item.ID = "Row" + i++; for(int j=0;j<7;j++) e.Item.Cells[j].ID="Column"+j; //Here you need to pass the rowid e.Item.Cells[j].Attributes.Add("ontextchanged","modif('"+ e.Item.ID + " ')" ); } JavaScript:- function modif(RowId) { //This line will set the value to 'Y' when the row is modified document.getElementById('DataGrid1_'+RowId +'_Modified').innerText="Y" } 3.When you give the provision for editing the rows you can also validate the datagrid. private void Page_Load(object sender, System.EventArgs e) { da.Fill(dataSet11,"employee"); DataGrid1.DataBind(); Button1.Attributes.Add("onclick","return validate()"); } JavaScript:- function validate() { if(document.getElementById('DataGrid1_Row0_Column1').innerText="") alert('Please enter '); //Like this you can set the values to the grid document.getElementById('DataGrid1_Row0_Column1').innerText="kkkk"; alert(document.getElementById('DataGrid1_Row0_Column1').innerText); return false; }
Kiran Kumar.CH (MCP)