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

Dropdownlist in datagrid

Guys,

I have a template column with a picture and when I
click on it I would like to enter edit mode and instead
of the picture being displayed I need a drop down list
populated with data.

once data is selected from the list I need to exit edit
mode and replace the picture with a hyperlink item.

Is this possible..?

I have added an edit item template to the grid with a
dropdownlist, but how do I enter edit mode as I cant seem
to be getting an event to change the edititemindex

I would appreciate any help

thanks

Darren
Nov 18 '05 #1
3 1098
On Tue, 29 Jun 2004 08:54:14 -0700, "Darren"
<an*******@discussions.microsoft.com> wrote:
Guys,

I have a template column with a picture and when I
click on it I would like to enter edit mode and instead
of the picture being displayed I need a drop down list
populated with data.

once data is selected from the list I need to exit edit
mode and replace the picture with a hyperlink item.

Is this possible..?

yes, although, it doesn't make sense to go from
picture->dropdown->linkbutton.

This is gonna be a headache and sounds like a nonintuitive interface.
I have added an edit item template to the grid with a
dropdownlist, but how do I enter edit mode as I cant seem
to be getting an event to change the edititemindex

I would appreciate any help


the command name should be 'edit' and you should make an eventhandler
for the editcommand event.

-adam
Nov 18 '05 #2
>>Guys,

I have a template column with a picture and when I
click on it I would like to enter edit mode and instead
of the picture being displayed I need a drop down list
populated with data.

once data is selected from the list I need to exit editmode and replace the picture with a hyperlink item.

Is this possible..?

yes, although, it doesn't make sense to go from
picture->dropdown->linkbutton.

This is gonna be a headache and sounds like a

nonintuitive interface.
I have added an edit item template to the grid with a
dropdownlist, but how do I enter edit mode as I cant seemto be getting an event to change the edititemindex

I would appreciate any help
the command name should be 'edit' and you should make an

eventhandlerfor the editcommand event.

-adam
.
Thanks for the quick answer adam

can you please clarify on the following questions

Can I use the HTML image tag instead of the link button
or is there any other way i can display the image
Imagebutton does not display the image

When it finally does enter edit mode does it make the
entire row editable..? I only want the current cell to be
made editable

and after the process is done can I change the cell to
have a link instead (i.e add a link control) in the event
handler

also I would appreciate if you could point me to some
examples

Thanks a lot

Nov 18 '05 #3
On Tue, 29 Jun 2004 09:21:21 -0700, "Darren"
<an*******@discussions.microsoft.com> wrote:


Can I use the HTML image tag instead of the link button
or is there any other way i can display the image
Imagebutton does not display the image

imagebutton should work. I'd trouble shoot the problem instead of
working around it.
When it finally does enter edit mode does it make the
entire row editable..? I only want the current cell to be
made editable

only the cells that are not readonly. If you only want the current
cell editable then you probably don't want to use a datagrid. a more
custom solution would be advisable.
and after the process is done can I change the cell to
have a link instead (i.e add a link control) in the event
handler
yes you can but this will need to be recreated during itemdatabound.
so you will need be able to detect that the value has been set and add
the link button each time.
also I would appreciate if you could point me to some
examples


I don't have examples cause you haven't clearly explained what you are
trying to do. I'd suggest instead of asking these questions about
specific functionality you should give us an overall description of
what you expect and how it should work and people may be able to
respond about how you might go about accomplishing what you want. I
don't think a datagrid is necessarily what you want if u're wanting to
click on each cell individually to edit them.

-Adam
Nov 18 '05 #4

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

Similar topics

12
by: Stanley J Mroczek | last post by:
How do you load a dropdownlist when edit is clicked in a datagrid ? <Columns> <asp:BoundColumn DataField="OptionDescription" ItemStyle-Wrap="True" HeaderText="Option...
2
by: rmorvay | last post by:
I am trying to dynamically build a dropdownlist and bind it to a cell in a grid. I tried to utilize the following code but I am stuck at the point where I bind the dropdownlist to the grid cell. ...
2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
0
by: Shane O. Pinnell | last post by:
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a datagrid populated from a dataset. I have a...
2
by: Shiju Poyilil | last post by:
Hello, I have a datagrid with only one row and its having 2 dropdownlists, I need to populate the secodn dropdownlist on the basis of the selection in the first dropdown. but I am not able to...
1
by: m3ckon | last post by:
Hi there, please help if you can, I'm having an issue with droponnlists in a datagrid I have a datagrid which is populated from a query .. all works fine I've added two extra columns, one...
3
by: Tim::.. | last post by:
Can someone please tell me how I go about preselecting an item in a drop drown list when I click the Edit Command in a datagrid? I have tried the following but it doesn't work for me! I would...
0
by: Daniel Doyle | last post by:
Hello and apologies in advance for the amount of code in this post. I've also sent this message to the Sharepoint group, but thought that ASP.NET developers may also be able to help, even though...
4
by: Mark Waser | last post by:
I've discovered a very odd bug when attempting to put a dropdown list in a datagrid. In the page PreRender step, the selected index of the datagrid is successfully set during databinding. Yet,...
15
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.