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

ASP.NET

 
AnswerRe: GridView Sorting Problem Pin
Sathesh Sakthivel12-Jul-07 3:48
Sathesh Sakthivel12-Jul-07 3:48 
GeneralRe: GridView Sorting Problem Pin
vickyshah12-Jul-07 3:52
vickyshah12-Jul-07 3:52 
GeneralRe: GridView Sorting Problem Pin
Not Active12-Jul-07 4:00
mentorNot Active12-Jul-07 4:00 
GeneralRe: GridView Sorting Problem Pin
Sathesh Sakthivel12-Jul-07 4:00
Sathesh Sakthivel12-Jul-07 4:00 
GeneralRe: GridView Sorting Problem Pin
Christian Graus12-Jul-07 4:00
protectorChristian Graus12-Jul-07 4:00 
GeneralRe: GridView Sorting Problem Pin
Not Active12-Jul-07 4:12
mentorNot Active12-Jul-07 4:12 
AnswerRe: GridView Sorting Problem Pin
Steve Echols12-Jul-07 16:32
Steve Echols12-Jul-07 16:32 
QuestionCheckbox in Datagrid Pin
Kurian_Kurian12-Jul-07 3:22
Kurian_Kurian12-Jul-07 3:22 
I add a asp Checkbox in the Datagrid ItemTemplate and HTML checkbox in Header Template.In the datagrid am loading the images and the path from the server folder.am loading all the images in the page load event.page load event as follows

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataSet ds = new DataSet();
DataTable dt = new DataTable("Photos");
dt.Columns.Add("Photos", Type.GetType("System.String"));
foreach (string Files in Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath("Photos"), "*.jpg"))
{
dt.Rows.Add(Files);
}
ds.Tables.Add(dt);
this.dgPhotos.DataSource = ds;
this.dgPhotos.DataBind();
}
}

All the images am getting in the Datagrid.but my problem is,i want to delete the checked images.the delete code as follows

foreach (DataGridItem item in dgPhotos.Items)
{
CheckBox chkBox = (CheckBox)item.FindControl("chkItem");
if (chkBox.Checked)
{
File.Delete(item.Cells[2].Text);
}
}
while clicking the Header template checkbox it will select all the Item template checkbox[Javascript function],all the sub checkbox are checking fine.but the problem is i will not get the checked state in the delete event,getting checkbox.checked=false.so i cannot delete the images.in the page load event if am not using !Postback and if i select one by one in the Itemtemplate checkbox i could delete,i will get checked=true but if select header check will not get.what is the problem.Is there any solution for this.

AnswerRe: Checkbox in Datagrid Pin
Paul Conrad13-Jul-07 12:18
professionalPaul Conrad13-Jul-07 12:18 
QuestionCheckboxes in gridview Pin
samerh12-Jul-07 2:30
samerh12-Jul-07 2:30 
AnswerRe: Checkboxes in gridview Pin
Christian Graus12-Jul-07 2:45
protectorChristian Graus12-Jul-07 2:45 
GeneralRe: Checkboxes in gridview Pin
samerh12-Jul-07 3:26
samerh12-Jul-07 3:26 
GeneralRe: Checkboxes in gridview Pin
Christian Graus12-Jul-07 4:55
protectorChristian Graus12-Jul-07 4:55 
QuestionGridView Pin
.NET- India 12-Jul-07 2:20
.NET- India 12-Jul-07 2:20 
AnswerRe: GridView Pin
Sathesh Sakthivel12-Jul-07 2:28
Sathesh Sakthivel12-Jul-07 2:28 
GeneralRe: GridView Pin
Not Active12-Jul-07 2:52
mentorNot Active12-Jul-07 2:52 
GeneralRe: GridView Pin
Pete O'Hanlon12-Jul-07 3:12
mvePete O'Hanlon12-Jul-07 3:12 
GeneralRe: GridView Pin
Not Active12-Jul-07 3:34
mentorNot Active12-Jul-07 3:34 
GeneralRe: GridView Pin
Pete O'Hanlon12-Jul-07 3:40
mvePete O'Hanlon12-Jul-07 3:40 
GeneralRe: GridView Pin
Not Active12-Jul-07 3:46
mentorNot Active12-Jul-07 3:46 
GeneralRe: GridView Pin
Sandeep Akhare12-Jul-07 3:46
Sandeep Akhare12-Jul-07 3:46 
GeneralRe: GridView Pin
Sathesh Sakthivel12-Jul-07 3:52
Sathesh Sakthivel12-Jul-07 3:52 
GeneralRe: GridView Pin
Sathesh Sakthivel12-Jul-07 4:02
Sathesh Sakthivel12-Jul-07 4:02 
AnswerRe: GridView Pin
Not Active12-Jul-07 2:53
mentorNot Active12-Jul-07 2:53 
Questionformat using javascript ##,###.00 Pin
Vipin.d12-Jul-07 2:07
Vipin.d12-Jul-07 2:07 

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.