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

handeling click event on a datagrid control in winforms app

Hi

i have a winforms app in vs2008 c#

i have a billingdatagrid on the form, and is shows 4 columns and many
rows of data.

The far left colum shows an arrow to inidcated the currently selected
row.

My problem is

when a user selects a row, then goes into an edit mode the rows
contents are displayed on a seperate panel on the form for
edit/update. while it is in this "edit" mode, i want to prevent the
user from selecting any other rows untill they exit this edit mode.

I cant work out how to do this, i was thinking to test the datagrid
click event and return e.handeled if in edit mode but the e args
passed in dont support the handled property.

Can anyone tell me how to test inside the datagrid click event, to
prevent the row selection being changed by the user, based on a
conditional checking
thanks for any help
Peted
Jun 27 '08 #1
2 1862
How about disabling the grid while the row is in edit mode..
grid.Enabled = false;
Just a thought,
jake

On Jun 5, 1:00 am, Peted wrote:
Hi

i have a winforms app in vs2008 c#

i have a billingdatagrid on the form, and is shows 4 columns and many
rows of data.

The far left colum shows an arrow to inidcated the currently selected
row.

My problem is

when a user selects a row, then goes into an edit mode the rows
contents are displayed on a seperate panel on the form for
edit/update. while it is in this "edit" mode, i want to prevent the
user from selecting any other rows untill they exit this edit mode.

I cant work out how to do this, i was thinking to test the datagrid
click event and return e.handeled if in edit mode but the e args
passed in dont support the handled property.

Can anyone tell me how to test inside the datagrid click event, to
prevent the row selection being changed by the user, based on a
conditional checking

thanks for any help

Peted
Jun 27 '08 #2

Thanks i will try that, it never occured to me

Peted
>How about disabling the grid while the row is in edit mode..
grid.Enabled = false;
Just a thought,
jake

Jun 27 '08 #3

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

Similar topics

0
by: Yoni Rapoport | last post by:
Hy everyone, just wanted to share a thought regarding UI. If you really think about it, events such as "Click", "DoubleClick", "KeyDown", "KeyUp", etc... (which clutter every winforms control we...
7
by: Marina | last post by:
Imagine a form with some fields and an OK buttons that saves the information. Each field has validation logic in the Validating event. If the input is not valid, the control's value is replaced...
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...
5
by: J McD | last post by:
Hi I have a DataGrid with an ImageButton column. When I click on an imagebutton I get a postback but it doesn't run the OnImgBtnClick method. I can actually comment out the line where I add this...
2
by: Niclas Lindblom | last post by:
Hi, I have a datagrid with linkbuttons. I would like to catch the click event when a link button has been clicked and use the string from the text value of the link button in a clientside Java...
3
by: PJ6 | last post by:
I've added a button to a class inheriting from System.Web.UI.Control and want to handle (pass on) its click event to the page that contains it. Coming from a WinForms background, I thought this...
7
by: Diane | last post by:
Hi- I've been struggling with this problem and none of the fixes posted seem to help out at all. Yet, it seems like such a simple problem... I have a DataGrid, and load it up with data on...
5
by: Steve | last post by:
I have a datagrid in a WinForm. When the user edits an entry in the datagrid, after he leaves that field, I would like to do some cheking. What event fires when the user does that? I need to...
5
by: Francois Searle | last post by:
Hi I have a datagrid that is popolated by a search result. I would then like to double click on a row to open the record in a new form. The double click doesn't seem to "fire"? I am relively...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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?
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...

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.