I have added a checkbox to my datagrid (programaticall y with
'DataGridBoolCo lumn'). It works great...except one thing...when I first
click on the checkbox in my grid it doesn't do anything...it's like its only
getting focus (it's not grey). After the initial click, I can toggle the
checkmark. The one thing I notice is the record pointer in the datagrid.
On the first click (into the cell), it's still an arrow. But when I start
to toggle the checkmark, I noticed it's a pencil.
Any advice?
Sorry, I'm a bit new to VB.NET.
-bruce duncan 2 2034
Figured it out...with thanks to http://64.78.52.104/FAQ/WinForms/default.asp
Private Sub DataGrid1_Mouse Up(ByVal sender As Object, ByVal e As
MouseEventArgs) Handles DataGrid1.Mouse Up
Dim intCheckBoxCol( ) As Integer = {4, 5, 6}
Dim hti As DataGrid.HitTes tInfo = Me.DataGrid1.Hi tTest(e.X, e.Y)
Try
For i As Integer = 0 To 2
If hti.Type = DataGrid.HitTes tType.Cell AndAlso hti.Column =
intCheckBoxCol( i) Then
Me.DataGrid1(ht i.Row, hti.Column) = Not
CBool(Me.DataGr id1(hti.Row, hti.Column))
End If
Next
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try
End Sub
-bruce
Figured it out...with thanks to http://64.78.52.104/FAQ/WinForms/default.asp
Private Sub DataGrid1_Mouse Up(ByVal sender As Object, ByVal e As
MouseEventArgs) Handles DataGrid1.Mouse Up
Dim intCheckBoxCol( ) As Integer = {4, 5, 6}
Dim hti As DataGrid.HitTes tInfo = Me.DataGrid1.Hi tTest(e.X, e.Y)
Try
For i As Integer = 0 To 2
If hti.Type = DataGrid.HitTes tType.Cell AndAlso hti.Column =
intCheckBoxCol( i) Then
Me.DataGrid1(ht i.Row, hti.Column) = Not
CBool(Me.DataGr id1(hti.Row, hti.Column))
End If
Next
Catch ex As Exception
MessageBox.Show (ex.ToString())
End Try
End Sub
-bruce This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: yoganand reddy |
last post by:
Hello,
we are developing component in c# like a datagrid , if u are selecting
any cell in grid it selects the total row and display record there
itself , if any body have this idea please share to me...
Yogi
*** Sent via Devdex http://www.devdex.com ***
|
by: orekinbck |
last post by:
Hi There
I have a datagrid whose main purpose in life is to provide a nice way
for users to make a single choice from a list. The grid is read only,
single row select and has its data source as an ArrayList.
I came up against the issue of selecting a cell and getting the whole
row to highlight, and the second issue of unhighlighting any previously
selected row. To get around these two issues I have put in a two prong
approach:
|
by: Randy |
last post by:
Hello,
Does anyone know if there's a way to unselect a cell. I've got a dialog
which opens when a cell is clicked. When the dialog closes I want to leave
that cell. I've tried things like doing an UnSelect on the row and setting
the CurrentCell to another cell but that doesn't work. I've also tried
doing...
dataGrid1.EndEdit(null, myHitTest.Row, true);
dataGrid1.BindingContext.DataGrid.DataMember].EndCurrentEdit();
but that didn't help...
|
by: hemant |
last post by:
hello everybody,
I am having a datagrid which has data regarding customers. it has a
penalty column, and i want to show the entire record of the customer
in red whose penalty is greater than zero.
i have looked into the other messages which guide to override the
paint procedure of the datagrid, make a new class etc.
i am not able to understand the exact way of doing the mentioned
|
by: Bruce D |
last post by:
I have added a checkbox to my datagrid (programatically with
'DataGridBoolColumn'). It works great...except one thing...when I first
click on the checkbox in my grid it doesn't do anything...it's like its only
getting focus (it's not grey). After the initial click, I can toggle the
checkmark. The one thing I notice is the record pointer in the datagrid.
On the first click (into the cell), it's still an arrow. But when I start
to toggle...
| |
by: Peter Proost |
last post by:
Hi group I'm making my own datagrid control, so for I've got a lot of things
working, combobox columns, checkbox columns, blobfield columns. But now I
would like to be able the disable certain columns for editing I know I can
use readonly for the columnstyle but this will also disallow me to edit the
cell when I add a new row.
So I was thinking of using the overrides sub Edit in my class which inherits
from DataGridTextBoxColumn
and then...
|
by: Thanks |
last post by:
Can I do that? I want to color the cell after updating by users! I was
writing some code but did not work ...
Private Sub DG_CurrentCellChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DG.CurrentCellChanged
Dim tableStyle As DataGridTableStyle
tableStyle = New DataGridTableStyle
tableStyle.MappingName = "x"
|
by: Gummy |
last post by:
Hello All,
I have a webpage that has two dropdown listboxes. Based on what is selected
in these dropdown listboxes, it filters a DataGrid . That works fine.
In the DataGrid , when I go to edit a row, I change the textbox (or other
control), click Update, but it doesn't save my data. I then did this...
In Page_Load, I added code to filter the DataGrid only when it was Not
Page.IsPostBack. Then the editing/updating of the DataGrid data...
|
by: sevenjerry |
last post by:
I am having a problem retrieving the productID(column) in datagrid when
check box in template column is checked. I need to loop through all
rows in the datagrid and save the productID for rows where Select
checkbox is checked in that row. Any ideas?
|
by: KA NMC |
last post by:
How do you raise an event when a cell in a row changes?
I'm using a Datagrid not a Datagrid view. What I want to do is - call my update param when the user changes a value in a cell. How can this be done?
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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,...
|
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...
|
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,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |