473,382 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

datagrid buttons columns not working - help

here is my datagrid, within a <form> tag

<asp:datagrid id="dlUserPhotos" runat="server" GridLines="None"
AutoGenerateColumns="False" OnItemCommand="dlUserPhotos_ItemCommand">
<Columns> <asp:TemplateColumn> <ItemTemplate> <img
src="/images/uploaded/<%# DataBinder.Eval(Container.DataItem,
"path")%>"> </ItemTemplate> </asp:TemplateColumn>
<asp:ButtonColumn Text="Remove" ButtonType="PushButton"
CommandName="RemoveButton" />
<asp:ButtonColumn Text="Default" ButtonType="PushButton"
CommandName="SetDefaultButton" />
<asp:BoundColumn DataField="id" Visible="False" />
</Columns>
</asp:datagrid>

and my code for handling the buttons:

public void dlUserPhotos_ItemCommand(object sender, DataGridCommandEventArgs
e)
{
Functions handle = new Functions();
int selectedID = Convert.ToInt32(e.Item.Cells[3].Text);

if (e.CommandName == "RemoveButton")
{

bool bDeleted = handle.DeletePhoto(selectedID);
}

if (e.CommandName == "SetDefaultButton")
{

bool bSet = handle.UpdateDefaultPhoto(iUserID, selectedID);

}

GetPhotos(iUserID); //Re-bind datagrid
}

I have a break point set on this function but it never gets touched. When I
click Remove Button, it just seems like all I get is a postback.

Have any idea what am I doing wrong here?
Nov 19 '05 #1
0 816

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
6
by: Jon | last post by:
Hello, I have a datagrid and the data in it is dynamically created at runtime... For iCounter = 0 To dataset.Tables(0).Columns.Count - 1 Dim objbc As New BoundColumn() With objbc .DataField...
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
6
by: Mark | last post by:
I have been working for quite some time on this issue which in theory should be quite simple. The problem is that the Cancel and Save events are not fired when their respective buttons are...
8
by: Inigo Jimenez | last post by:
I have an ASP .net web application installed in a Windows 2003 server. This web application has a webform that has a Datagrid. This Datagrid is filled with the data of a SQL table. I have a...
4
by: DrData | last post by:
I'm working on an ASP.Net application written in C#. On one page, there are several datagrid controls used to display, edit and delete detail records relating to the master record also displayed on...
0
by: kevin_giles78 | last post by:
hello everyone. There may be a better way to do what I want but please bear with me as I need a simple explanation of how to do something with a data grid. I have a grid showing a status in a...
0
by: slemen | last post by:
Hi, The asp:EditCommandColumn template does not fire the _edit sutboutine when the edit command column buttons are clicked. I get a Page Cannot Be Displayed page error instead. My (ASP 1.1)...
1
by: Steven Van Eyck | last post by:
Hi there There are probably lots of questions being posted about datagrids, but I can't resist... ;-) Here's my issue: I have an aspx page with a datagrid in which I manually declare the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.