473,406 Members | 2,336 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,406 software developers and data experts.

Editing in gridview

Hi experts

I have googled for tips/solutuins and failed to get a right method to implement following scenario.

I have a gridview populated with data on page load from my sourcetable.
Tomake it precise say I have fields Ac_Id, Ac_Name, Balance, and user_Id in my table accounts. The user_Id and Ac_Id forms the composite key.

I have 3 rows in my table as follows

1, Cash, 1000, ABC
2. CITI, 8000, ABC
3. BOA , 6000, ABC

While editing in grid I want let user edit only the balance field if Ac_Name is Cash otherwise User can Edit both Ac_Name and Balance.

Kris
Mar 22 '10 #1
3 2193
CroCrew
564 Expert 512MB
Hello krisviswa,

Please post your code so we know what we are working with to help you out.

Thanks,
CroCrew~
Mar 24 '10 #2
Dear Mr.cro

thanks for volunteering help. I could solve the issue in row_upadating event by checking the values from edit item template text boxes and changing the textbox bind property to read only if the value is cash.
Expand|Select|Wrap|Line Numbers
  1. Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
  2.         name = CType(GridView1.Rows(e.RowIndex).FindControl("Textbox1"), TextBox) )
  3.         If name.Text = "Cash"  then
  4.         name.Text="'<%#Eval("Ac_Name") %>'"
  5.  
regards and look forward for same cooperation in future issues

thanks once again
kris
Mar 25 '10 #3
CroCrew
564 Expert 512MB
Anytime.

Happy coding,
CroCrew~
Mar 25 '10 #4

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

Similar topics

0
by: Fred K. Augustine, Jr | last post by:
After upgrading from Visual Web Developer Beta2 to the final release version, web forms that contained GridView controls set up for data editing stopped working properly. No error is produced but...
5
by: misiek | last post by:
Hi all. I would like to know if it is possible to dynamically enable/disable row editing in GridView control in ASP.NET 2.0. I am asking because this feature should be enabled/disable depending...
1
by: K B | last post by:
I just installed VS 2005...both GridView and DetailsView, I'm using a SQLdataSource and both controls do NOT have a checkbox for Enable Editing. Help please!!! Thanks, Kit
1
by: AmitKu | last post by:
I've got the Gridview going at full speed, and I've enabled editing, but when I click on the "edit" button, this ugly editing UI comes up. Well it's not ugly, but it's not great either. How do I...
0
by: HP | last post by:
Hi there I have a datalist control with some bound controls in its Item Template and a gridview bound to one of those fields (residing also in Item Template). I've found out that when I click...
3
by: cpnet | last post by:
I have a GridView which I'm populating from an ObjectDataSource (give the GridView a DataTable). The GridView will have about 20 rows, and only one editable column. The editable column consists...
5
by: =?Utf-8?B?QWRhciBXZXNsZXk=?= | last post by:
Hi All, I have a GridView inside the EditItemTemplate of a FormView. Both FormView and GridView are data bound using an ObjectDataSource. When the FormView's ObjectDataSource object has a...
2
by: vinodkus | last post by:
<asp: editCommandColumnis not available in version 2.0 then how an editing is possible in gridview.
5
by: =?Utf-8?B?Z3V5?= | last post by:
How do you enable editing in a GridView programatically rather than via its Tasks menu? Guy
4
by: ASPnewb1 | last post by:
Hello, I have a 2-dimensional array created from the following text file: data1=asdfawe data2=2 data3=223d data4=22
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
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...
0
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,...

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.