Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing grid entries via ComboBox

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I need to have a GridView component (or AspxGridView if need be) on a web page - and be able to have a ComboBox (or equivalent) in one of the columns.
This will show a status for the respective record - i.e. 'Pending', 'Active', 'Completed', 'Cancelled', etc. - which is stored as an integer and then converted to show the corresponding text.
Next to the ComboBox I want to show an Image (with an appropriate colour circle - but easy visual review).

I want the user to quickly be able to change an entry in the ComboBox - and it fire the update against the underlying SQL database table - hold the newly selected ComboBox value and change the Image so that the appropriate colour circle is now shown.

I want to be able to achieve all this without having to completely reload the GridView.

Can someone direct me to a simple example / walkthrough of how to achieve this. I've seemingly gone round and around in circles with this.

Any help would be greatly appreciated.

Thanks in advance.
Steve
 
yes, all that is possible. take it one step at a time.
1. get the data on screen
2. make it editable
3. update the edited information
4. convert the edit/update to use ajax
5. add prettiness

most people on this forum like webforms for asp.net development. I'm not one of them :) I prefer an MVC framework and manually write the html myself. more control, easily flexible.

as for the actual code. i won't give you that. but I will provide some pointers.
you will need ajax to do some fancy user interaction.
if you are using webforms:
you will not be able to use the GridView since you do not want to reload the grid after each request.
do not use any of DataSource gui controls offered in webforms. they are not testable, or debugable. in your scenario they are not of much use anyway.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
I'm familiar with the building blocks - i.e. getting the data, loading the data, etc.
It's more the means of putting it all together hence the request for a walkthrough / sample to follow.

Can anyone suggest one that can be followed?

Thanks again.
 
if you are using webforms:
you will not be able to use the GridView since you do not want to reload the grid after each request.
If you use AJAX, you can use a gridview. It will reload the grid, but the user will not notice that it is being reloaded.
 
I'm still battling with this and making no progress (too stubborn for my own good!).

Are there any decent walkthroughs out there that I've overlooked?

Anything like that would be of great help.
 
the quick and dirty way... get it working without ajax, inline gridview edit 101. then wrap the whole mess in an ms ajax update panel, to remove the appearance of a postback. then add prettiness.

while you don't get the true benefits of ajax, from an update panel and gridview databind, it will get you started.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top