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

overrtiding Edit in a datagrid

Hi,
I have a datagrid and a datatable, and have overrided the Edit method so
that the background cellcolor isn't effected when a cell is clicked on.
Everything's fine, although now the column won't sort when clicking at the
top. Here is some of my code:
from Form 1:
PropertyDescriptorCollection pcol =
this.BindingContext[tCat].GetItemProperties();
DataGridTableStyle ts1 = new DataGridTableStyle();
ts1.MappingName = "Catalog";
ts1.AllowSorting = true;
DataGridColumnStyle cCust;
cCust = new PaintDG(pcol["Catalog"]);
cCust.MappingName = "Customer";
cCust.HeaderText = "Customer";
cCust.Width = 210;
ts1.GridColumnStyles.Add(cCust);

public class PaintDG : DataGridTextBoxColumn
{
public PaintDG(PropertyDescriptor pcol)
{
}
protected override void Edit(CurrencyManager Source, int RowNum,Rectangle
Bounds, bool ReadOnly,string InstantText, bool CellIsVisible)
{
}
}
Any idea what I need to do?
Thanks!!!
Mel
Jan 9 '06 #1
1 1034
Hi again,
I don't know why this happens, I struggle for hours, even days to get
something working and finally ask you guys. Then two minutes later I figure
it out.
Thanks though!
Mel

"melanieab" wrote:
Hi,
I have a datagrid and a datatable, and have overrided the Edit method so
that the background cellcolor isn't effected when a cell is clicked on.
Everything's fine, although now the column won't sort when clicking at the
top. Here is some of my code:
from Form 1:
PropertyDescriptorCollection pcol =
this.BindingContext[tCat].GetItemProperties();
DataGridTableStyle ts1 = new DataGridTableStyle();
ts1.MappingName = "Catalog";
ts1.AllowSorting = true;
DataGridColumnStyle cCust;
cCust = new PaintDG(pcol["Catalog"]);
cCust.MappingName = "Customer";
cCust.HeaderText = "Customer";
cCust.Width = 210;
ts1.GridColumnStyles.Add(cCust);

public class PaintDG : DataGridTextBoxColumn
{
public PaintDG(PropertyDescriptor pcol)
{
}
protected override void Edit(CurrencyManager Source, int RowNum,Rectangle
Bounds, bool ReadOnly,string InstantText, bool CellIsVisible)
{
}
}
Any idea what I need to do?
Thanks!!!
Mel

Jan 9 '06 #2

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

Similar topics

6
by: Tamir Khason | last post by:
How to prevent the selected cell from being editable (visual) at DataGrid? Once click on cell (even readonly) there are cursor inside it and select text appears. How to prevent it Thankx
2
by: Sky | last post by:
Hello: Another question about trying to wring functionality from a DataGrid... Have a DB table of "Contacts" -- 14 or more fields per record Show in datagrid -- but only 5 columns (First,Last,...
3
by: Leo | last post by:
I have a datagrid with the first column as a Edit,Update,Cancel button column. The other 5 columns are template columns. When I click the Edit button in IE6 the row correctly displays the...
7
by: julian.tklim | last post by:
Hi, I need to build an editable Datagrid with add & delete buttons on each row using javascript. DataGrid need not be pre-populated with values. To make the thing complicated, one of the...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
0
by: arlie_maija | last post by:
Hey - I'm writing a control that contains a DataGrid, and I'm unable to get the update event to fire. When I click the update link, the edit event fires. heres the details... my control...
1
by: Andrew Wan | last post by:
Is it possible to make some of the DataGrid functionality to client-side? Such as the Edit, Update, Cancel, Delete functionality? Everytime I click on a row's Edit button, I wait 2 seconds...
1
nateraaaa
by: nateraaaa | last post by:
While working on a recent project I discovered how useful the CommandArgument property can be. I needed to determine the record_id of a row displayed in my datagrid. When the user clicked the Edit...
8
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
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,...
0
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...

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.