473,379 Members | 1,201 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,379 software developers and data experts.

Images in DataGrid

Hi all

I have a DataGrid which has two Template Columns both having Image Buttons
in it
One column has UP image and the other has DOWN image used to reorder rows in
the grid.

How do i handle the events to these images. Working on the ImageButton click
events doesnt help. I thought ItemCommand event would work but didnt.

Any suggestions?

Thanks
Sekhar
Apr 18 '06 #1
2 1089
You have:-<asp:ImageButton runat="server" ToolTip="Click to move this row
up" ImageUrl="up.gif" ID="btnUp"
CommandName="MoveUp" />
<asp:ImageButton runat="server" ToolTip="Click here to move this row
down" ImageUrl="down.gif" ID="ImageButton1"
CommandName="MoveDown" />
in ur aspx page and in codebehind do:-

void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{

switch (e.CommandName)
{
case "Up":

}

{
case "Down":

}
Phillip posted a sample on his site if you are interested in re-ordering the
rows..
I just can't remember the link.
I have a sample implementation but not with me.
Hope that helps
Patrick

"Sekhar" <Se****@discussions.microsoft.com> wrote in message
news:ED**********************************@microsof t.com...
Hi all

I have a DataGrid which has two Template Columns both having Image Buttons
in it
One column has UP image and the other has DOWN image used to reorder rows
in
the grid.

How do i handle the events to these images. Working on the ImageButton
click
events doesnt help. I thought ItemCommand event would work but didnt.

Any suggestions?

Thanks
Sekhar

Apr 22 '06 #2
Hi
I tried on those lines. It doesnt work. When i click on the ImageButton the
CLick event for the ImageButton is fired but not the ItemCommand Event

Thanks
Sekhar
"Patrick.O.Ige" wrote:
You have:-<asp:ImageButton runat="server" ToolTip="Click to move this row
up" ImageUrl="up.gif" ID="btnUp"
CommandName="MoveUp" />
<asp:ImageButton runat="server" ToolTip="Click here to move this row
down" ImageUrl="down.gif" ID="ImageButton1"
CommandName="MoveDown" />
in ur aspx page and in codebehind do:-

void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{

switch (e.CommandName)
{
case "Up":

}

{
case "Down":

}
Phillip posted a sample on his site if you are interested in re-ordering the
rows..
I just can't remember the link.
I have a sample implementation but not with me.
Hope that helps
Patrick

"Sekhar" <Se****@discussions.microsoft.com> wrote in message
news:ED**********************************@microsof t.com...
Hi all

I have a DataGrid which has two Template Columns both having Image Buttons
in it
One column has UP image and the other has DOWN image used to reorder rows
in
the grid.

How do i handle the events to these images. Working on the ImageButton
click
events doesnt help. I thought ItemCommand event would work but didnt.

Any suggestions?

Thanks
Sekhar


Apr 24 '06 #3

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

Similar topics

2
by: Celine | last post by:
I am building a website using C#, asp.net and SqlServer. I need to store a lot of images in my database. I need to store thumbnails but also larger pictures(when user clicks thumbnails a larger...
3
by: | last post by:
Hi, I have a SQL Server database table where one of the columns is of type Image. The problem occurs when I try to retrieve images from the table. I'm using the following C# code: ...
2
by: John Do | last post by:
Hi, I want to store the path and the name of the images in a sql 2000 database and all the images in a folder named images. And then I want to display all the images in a datagrid. Does any one...
13
by: moondaddy | last post by:
Happy Holidays All! I want to load a datagrid with images and text (Image, text, image, text, etc...). The data for this datagrid will be coming from sql server and the images are stored as files...
4
by: Raghu Raman | last post by:
Hi, I want to load the images from my sqlserver200 db to the datagrid.I've seen a code from odetocode.com and it recreated to my wish. Database : Northwind;Table : from Employees , i want to...
9
by: tshad | last post by:
Is there a way to use your own image in place of the automatic one that ASP uses when doing editing in your DataGrid pages? We already have a style of button we are using and would like to be...
0
by: Tim::.. | last post by:
Please, please, please help!!! I have a datagrid that displays a list of contacts on our intranet site using the ActiveDirectory as it's main Data Source. I want to be able to show an image of...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
76
by: rcoco | last post by:
Hi all, I'm facing this problem I have images on my website but when I Deploye the website on server the Images are not there I only get the X sign. How can I go about this. Thanks
2
by: pozze | last post by:
Hi, I need to display images and other record information retrieved from an SQL 2005 database in a datagrid on a web page. I'm coding in VB .net I have recently changed over from VB ASP and i'm...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.