Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,404 members, 7,836,618 topics. Date: Wednesday, 22 May 2024 at 10:37 AM

Data Editing In Cells - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Data Editing In Cells (968 Views)

I Need A Programmer To Do Some Editing In My Site / All For Free! Learn Web Design, Digital Marketing, Graphic Designs,video Editing / Real Time Image Editing (2) (3) (4)

(1) (Reply)

Data Editing In Cells by maplecurie: 6:55pm On May 24, 2016
Hello, can someone tell me how i can edit data in cells. I am using .Net grid. thanks
Re: Data Editing In Cells by johnievillie124: 7:01pm On May 24, 2016
maplecurie:
Hello, can someone tell me how i can edit data in cells. I am using .Net grid. thanks



a good question. Dapfor NetGrid expands its features with UITypeEditorEx class. This class has an enhanced set of methods that can be used to create an arbitrary control directly over data cell and to use it for editing.
the code below should be of help.



//This editor creates a clickable button inside the cell
class MyEditor : UITypeEditorEx
{
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.None;
}

public override StopEditReason EditCell(IGridEditorService service, Cell cell, StartEditReason reason)
{
using(Button button = new Button())
{
//Add a reaction on user click
button.Click += delegate
{
//Close control with some reason
service.CloseCellControl(StopEditReason.UserStop);

//Set a new value if needed
cell.Value = _newvalue_;
};

//Start editing in cell
return service.CellEditControl(button, cell.VirtualBounds, reason);
}
}
}

(1) (Reply)

Professional Web Development Course / Are A Specialist In Social Media? / Notice For Those That Have Passion For Programming

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.