471,321 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 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 1002
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Tamir Khason | last post: by
3 posts views Thread by Leo | last post: by
7 posts views Thread by julian.tklim | last post: by
9 posts views Thread by rn5a | last post: by
reply views Thread by arlie_maija | last post: by
1 post views Thread by Andrew Wan | last post: by
8 posts views Thread by =?Utf-8?B?bWlrZWc=?= | last post: by
reply views Thread by rosydwin | last post: by

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.