Click here to Skip to main content
15,920,596 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to change data field property of a bound field column in gridview [modified] Pin
here2learn19-Sep-07 4:47
here2learn19-Sep-07 4:47 
AnswerRe: How to change data field property of a bound field column in gridview Pin
eggsovereasy19-Sep-07 5:22
eggsovereasy19-Sep-07 5:22 
QuestionHow do we insert excel file data into database sqlserver 2000 Pin
Sankar Komma 19-Sep-07 4:33
Sankar Komma 19-Sep-07 4:33 
Questionimpersonation Pin
mukkanti00719-Sep-07 4:01
mukkanti00719-Sep-07 4:01 
AnswerRe: impersonation Pin
Krugger40419-Sep-07 4:28
Krugger40419-Sep-07 4:28 
QuestionProgrammatically Getting the values of currenly displaying Details View Fields Pin
kumswa19-Sep-07 4:01
kumswa19-Sep-07 4:01 
QuestionHow to Dynamically populate Checkbox in Gridview asp.net 2.0 Pin
SJSaranya19-Sep-07 3:11
SJSaranya19-Sep-07 3:11 
AnswerRe: How to Dynamically populate Checkbox in Gridview asp.net 2.0 Pin
saini arun19-Sep-07 17:52
saini arun19-Sep-07 17:52 
Hi!
I am asuming that you have placed check box in your grid. You have a delete button in your page. When you click on that button, it will delete all records for which the check boxes were checked.
If you have a different scenario then plz let me know.

You can use the following code in the onclick event of that button.


protected void btnDelete_Click(object sender, ImageClickEventArgs e)
{
string strUserId = "";
foreach (GridViewRow gv in gvUsersToDelete.Rows) //traverse thru each row of the grid
{
//chkDelete is the name of the checkbox you placed in the grid. We first find that checkbox from the current gridview row and get it in a local checkbox type object, cb.
CheckBox cb = (CheckBox)gv.FindControl("chkDelete");
if (cb.Checked == true) // now check if the check box in this row is checked or not
{
// our grid had User ID in its column 0. So we are getting the userid from the 0th column in the //current row.
strUserId = gv.Cells[0].Text;
DeleteThisUser(strUserId); // passing userid to DeleteThisUser function.
}
}
}

private void DeleteThisUser(String strUserId)
{
// code to delete the matching strUserId.

“The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”

QuestionHow to show customize message in messagebox using c#(ASP.NET) Pin
Malayil alex19-Sep-07 3:04
Malayil alex19-Sep-07 3:04 
AnswerRe: How to show customize message in messagebox using c#(ASP.NET) Pin
Guffa19-Sep-07 7:37
Guffa19-Sep-07 7:37 
GeneralRe: How to show customize message in messagebox using c#(ASP.NET) Pin
Malayil alex19-Sep-07 23:57
Malayil alex19-Sep-07 23:57 
GeneralRe: How to show customize message in messagebox using c#(ASP.NET) Pin
Guffa20-Sep-07 6:40
Guffa20-Sep-07 6:40 
QuestionDisplaying User Information Pin
Brendan Vogt19-Sep-07 2:38
Brendan Vogt19-Sep-07 2:38 
AnswerRe: Displaying User Information Pin
Not Active19-Sep-07 2:58
mentorNot Active19-Sep-07 2:58 
Questionmemory usage accumulating continually over time Pin
saniy19-Sep-07 2:16
saniy19-Sep-07 2:16 
AnswerRe: memory usage accumulating continually over time Pin
Guffa19-Sep-07 7:42
Guffa19-Sep-07 7:42 
GeneralRe: memory usage accumulating continually over time Pin
saniy21-Sep-07 23:23
saniy21-Sep-07 23:23 
QuestionDataGrid data into PDF format Pin
That's Aragon19-Sep-07 2:10
That's Aragon19-Sep-07 2:10 
AnswerRe: DataGrid data into PDF format Pin
Imran Khan Pathan19-Sep-07 2:21
Imran Khan Pathan19-Sep-07 2:21 
GeneralRe: DataGrid data into PDF format Pin
That's Aragon19-Sep-07 2:24
That's Aragon19-Sep-07 2:24 
GeneralRe: DataGrid data into PDF format Pin
Imran Khan Pathan19-Sep-07 2:42
Imran Khan Pathan19-Sep-07 2:42 
GeneralRe: DataGrid data into PDF format Pin
That's Aragon19-Sep-07 2:56
That's Aragon19-Sep-07 2:56 
Questioncreating image of a web page Pin
Kapil Thakur19-Sep-07 2:00
Kapil Thakur19-Sep-07 2:00 
AnswerRe: creating image of a web page Pin
Krugger40419-Sep-07 4:36
Krugger40419-Sep-07 4:36 
Questioncan i include .aspx into another .aspx file ? Pin
anuragbajpai19-Sep-07 1:59
anuragbajpai19-Sep-07 1:59 

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.