Click here to Skip to main content
15,908,906 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: deploying webform? Pin
nclauder17-Jan-07 2:02
nclauder17-Jan-07 2:02 
GeneralRe: deploying webform? Pin
kiran kumar[Intelligroup]17-Jan-07 2:21
kiran kumar[Intelligroup]17-Jan-07 2:21 
GeneralRe: deploying webform? Pin
nclauder17-Jan-07 19:21
nclauder17-Jan-07 19:21 
QuestionCropping images in asp.net Pin
yogita charhate16-Jan-07 19:41
yogita charhate16-Jan-07 19:41 
AnswerRe: Cropping images in asp.net Pin
Rahithi17-Jan-07 4:30
Rahithi17-Jan-07 4:30 
QuestionAudio Streaming Pin
M A A Mehedi Hasan16-Jan-07 19:17
M A A Mehedi Hasan16-Jan-07 19:17 
QuestionDataGrid Pin
Rahithi16-Jan-07 17:35
Rahithi16-Jan-07 17:35 
AnswerRe: DataGrid Pin
kiran kumar[Intelligroup]16-Jan-07 20:28
kiran kumar[Intelligroup]16-Jan-07 20:28 
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)

QuestionCreate Profile. Going crazy ... Pin
shapper16-Jan-07 13:46
shapper16-Jan-07 13:46 
QuestionGridView RowDeleting event not firing Pin
alimohammed16-Jan-07 10:04
alimohammed16-Jan-07 10:04 
AnswerRe: GridView RowDeleting event not firing Pin
Venkatesh Mookkan16-Jan-07 17:28
Venkatesh Mookkan16-Jan-07 17:28 
QuestionBrowser back button Pin
javierarka16-Jan-07 9:12
javierarka16-Jan-07 9:12 
AnswerRe: Browser back button Pin
alimohammed16-Jan-07 10:52
alimohammed16-Jan-07 10:52 
AnswerRe: Browser back button Pin
MoustafaS16-Jan-07 13:12
MoustafaS16-Jan-07 13:12 
Questionbuttons and ajax (best practice) Pin
Leo Smith16-Jan-07 8:58
Leo Smith16-Jan-07 8:58 
AnswerRe: buttons and ajax (best practice) Pin
Christian Graus16-Jan-07 9:04
protectorChristian Graus16-Jan-07 9:04 
GeneralRe: buttons and ajax (best practice) Pin
Leo Smith16-Jan-07 9:30
Leo Smith16-Jan-07 9:30 
GeneralRe: buttons and ajax (best practice) Pin
Christian Graus16-Jan-07 13:14
protectorChristian Graus16-Jan-07 13:14 
GeneralRe: buttons and ajax (best practice) Pin
Leo Smith16-Jan-07 14:31
Leo Smith16-Jan-07 14:31 
GeneralRe: buttons and ajax (best practice) Pin
Leo Smith17-Jan-07 2:15
Leo Smith17-Jan-07 2:15 
AnswerRe: buttons and ajax (best practice) Pin
Bassam Saoud16-Jan-07 9:22
Bassam Saoud16-Jan-07 9:22 
GeneralRe: buttons and ajax (best practice) Pin
Leo Smith16-Jan-07 14:36
Leo Smith16-Jan-07 14:36 
QuestionRe: buttons and ajax (best practice) Pin
Venkatesh Mookkan16-Jan-07 17:23
Venkatesh Mookkan16-Jan-07 17:23 
AnswerRe: buttons and ajax (best practice) Pin
Leo Smith17-Jan-07 0:26
Leo Smith17-Jan-07 0:26 
QuestionSpecial Character Replacement Pin
Marc Paliotti16-Jan-07 8:58
Marc Paliotti16-Jan-07 8:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.