Visual Basic.NET - Who knows how to do this???

 
Vista:

Who knows how to do this???

Publicado por George (2 intervenciones) el 23/10/2005 03:18:01
How do I set cell color (one by one) in a datagrid.
I set the columns (with tablestyles), according to a range of time (dinamically), so, the datagrid is not built by a specific datasource, I mean, I declare a DataTable with 4 defined columns, and the others are made dinamically.

Then, I get some records from the database, and I make a "foreach" sentence to loop trough the records, for each record I made a DataRow and I set the values for "myRow[indexColumn]", after that I add that row to the DataTable that I declared before.

Well, I've been using Events and custom DataGridTextBox in order to solve my problem...but it doesn't work yet, when I declared my DataGridTextBox to a TableSyle, I set a Handler
/********************************************************/
aColAE.MappingName = "ENC";
aColAE.HeaderText = "ENC";
aColAE.Width = 35;
aColAE.Alignment = HorizontalAlignment.Left;
aColAE.NullText = "";
aColAE.TextBox.Enabled = false;
aColAE.ReadOnly = true;
aColAE.DataGridDisableCell += new DataGridDisableCellHandler(SetEnableValues);
/**********************************************************/
and the handle works, in fact, the cell is painted...but applies for all the cells that belongs to a specific column...but I need for a specific cel, depending on some values.

I 've checked this links

http://www.codeproject.com/csharp/Custom_DataGridColumnStyl.asp
http://www.dotnet247.com/247reference/msgs/51/256341.aspx
http://www.akadia.com/services/dotnet_datagrid_disable_cell.html
http://www.syncfusion.com/FAQ/WindowsForms/

I'm very stressed about this...please, if someone knows how to do that, let me know.

Thanks in advance!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Who knows how to do this???

Publicado por David Medina (41 intervenciones) el 23/10/2005 15:44:02
Hi, i found a custom datagrid where you can do what you're trying to.
It's name is SourceGrid, and the link is:
http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp

This is a different grid 'cause you can navigate and do whatever with any cell.

i wish it works for you!

http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Who knows how to do this???

Publicado por George (2 intervenciones) el 24/10/2005 15:46:52
Thanks David, I really apreciate it!

It's a very nice custom datagrid, however, I prefer create one from scratch, the only thing that I can't do is set a Event for each cell in the datagrid. I think that my problem is create the columns (with tablestyles an DataTable) before set the DataSource.

That I need to do is a Gantt chart, depending on a range of time.
In the database I have the range (firstDay, lastDay), but I create the columns according to a specific days selected from two DateTimePicker,and then I read each row from the database...I should match some values for each row against some values in the logic or against some column names.

Has someone any idea?

I'll come to think on it for a long time...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Who knows how to do this???

Publicado por David Medina (41 intervenciones) el 24/10/2005 19:49:17
Well, if you need to creat a gantt diagram, you can find a simple example at codeproject.com

I've seen something like that, but i don´t remember exactly the place...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar