473,771 Members | 2,347 Online
Bytes | Software Development & Data Engineering Community
+ 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 2067
PRR
750 Recognized Expert Contributor
Can you specify what exactly you want to do? You can handle the Gridview.Rowupd ating event for Gridview and do the update. Obviously you need have TemplateField with EditItemTemplat e.
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.Visibl e=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
2804
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 (asp.net control) 1 - Bound column - DisplayName from data table the checkbox is just a template i made by placeing an asp.net control into the item template when I check items on the grid then click the link and execute the following
1
422
by: sonali_aurangabadkar | last post by:
i want to edit whole grid on singel button click
2
3860
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 written the following code. <div id="Layer1" style="width:350px; height:140px; z-index:1;overflow-y: scroll"> But the problem was scroll bar will be there if there no data aviabale in
0
1240
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 wrap property to false in my source code for every column.so in my output i get my data in a single line and the cell width adjusts according to it.but i want my cell width to be small and data to appear in a single line, meaning if i have a big data...
1
1209
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 can i resize it?what code should i write for that?i am using c#. so can someone give me the code for that? Please help.Thanking in advance.
0
1153
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
1916
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. When editing a row within the Grid View, the columns that are not referenced, are being set to null. Is this by design or am I missing something else somewhere?
1
2880
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 sort columns? Thanks
3
1113
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 grid_Row Editing Event to edit the grid.......which command should use to update the data........and send me sample update code in ADO connection
0
2748
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 source contains lots of columns and some of these i do not want to show on the grid. Is there a property/option where i can just get my specified columns to show, without resorting to removing each column programticly. Thanks, James Coverdale
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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 we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.