473,473 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Have a probem in Editing in the row of grid view in a strange way?

96 New Member
actually i want to edit the row of an grid view by code behind not using any sql data source. u know that that show edit button property in a grid view

when we set this property to true & simply connect it to the sql data source
we use a update command property in sql data source
by doing all this we create a such type of data grid in which
edit button is display in every row when u click on edit button then the corresponding row is opened in editable form. & update & cancel button is display when u hit on update button the value is updated & row is converted in noneditable form.....

Now i donot want to use edittemplate & donot want to add textboxes in edit template
& donot want to use sqldatasource
can we do the above thing by code behind just like i mention in the above details
by using such type of property which i discusses above
that we can open a row of an grid view in editable form without using edittemplate
& update the data from codebehind which value i mention in editable row.
Thank you
May 19 '10 #1
6 2052
PRR
750 Recognized Expert Contributor
Can you specify what exactly you want to do? You can handle the Gridview.Rowupdating event for Gridview and do the update. Obviously you need have TemplateField with EditItemTemplate.
May 20 '10 #2
AnagJohari
96 New Member
@PRR
you just add show edit button property in grid view & run the program Then grid view will display edit button in every row of an grid view i know that when you click on edit button there is an error because of unhandling the event.
u know that when i use sql datasource & use updatecommand property & write update query in update command & after that bind sqldatasource with grid view
after that you run your program & click on edit button then row is opened in editable form & updation is done....
Same functionality i want to use through code behind without sql datasource
May 20 '10 #3
PRR
750 Recognized Expert Contributor
Go to gridview properties and click on events... you need to handle the appropriate events.
Link
May 20 '10 #4
Frinavale
9,735 Recognized Expert Moderator Expert
AnagJohari: Then grid view will display edit button in every row of an grid view i know that when you click on edit button there is an error because of unhandling the event
You do not have to use the SqlDataSource. I never do....
In fact I'm doing exactly what you want to do in several different projects.

I created a Web User Control used for display/editing purposes. This control is on the same page as the GridView but is invisible (Visible=false) so it's not rendered.

When the user clicks the edit button...it is handled by the method in my VB.NET code (this could be C#...same difference) which retrieves the data from the row selected for editing and uses that to populate the Web User Control with information. After the Web User Control is populated, I set the GridView.Visible=False and my Web User Control.Visible = True.

Now the GridView is hidden and the user sees the editable details.


I use this technique because the GridView only displays general information and the Web User Control displays all of the information about whatever the user is working with.

So, please look at the link that PRR posted.
It explains how to Handle the Editing event.

Then consider what I said and give it a try.

-Frinny
May 20 '10 #5
AnagJohari
96 New Member
@Frinavale
your mean i create such type of webcontrol in which when you hit a perticular row in a grid view then grid view is disappear & that perticular row is displayed in editable form with the stored data & after doing changes in that perticular row that editable row is disappear & the grid view with updated that row will appeared.
i want to use a grid view also for that editable row in which we do changes
That thing you explain me.......
May 20 '10 #6
AnagJohari
96 New Member
@PRR
now i have completed all this by handling event. but i want this in diffrent manner as frinny mentioned
May 20 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Smokey Grindle | last post by:
I have the following on my page... a link button that will send the command name "use" to the command handler and a grid view with the following columns 0 - Template column - just a checkbox...
1
by: sonali_aurangabadkar | last post by:
i want to edit whole grid on singel button click
2
by: Umeshnath | last post by:
Hi, I have placed a grid view inside Atlas panel. On click of a button event, data is populated in the grid view, I want to add scroll bar instead of increasing the size of grid view. I have...
0
by: anuparvathy | last post by:
Hi I am creating a website using visual studio 2005. In the design view of my asp.net page i have placed a grid view and then i have connected it to the database also. i have set the item style...
1
by: anuparvathy | last post by:
Hi all! I am creating a website using visual studio 2005.in my design view of asp.net page i have placed a grid view in the form.now i want to resize the width of each and every cell.how...
0
by: Zuhaib Hyder | last post by:
how can i sort my grid view widout using data source ......... i have binded my grid view wid coding ( using code smith )...... ????????
3
by: Andrew Robinson | last post by:
I have a Grid View and associated Object Data Source control. The ODS interface with a custom data source that returns a List<MyEntity>. I am only referencing some of the columns on the GridView....
1
by: Jerry | last post by:
Hi I have a data grid view that I have AllowUserToResizeColumns = True but at runtime, the user cannot resize columns. Is there something I am missing? Is there a conflict with the ability to...
3
by: thiagarajanrsbe | last post by:
Dear All, I have one problem in gridview.Im using C# code and ADO connection. In the grid view ,data is not updated in the update link....Please hep me to solve this issue......... Im use...
0
by: cadab | last post by:
I have a data grid view, i have specified several columns through the designer that i would like to show on the grid, i have mapped them to the datasource, this works fine, the problem is, my data...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.