Very Low Activity

News

  Analyzed 7 days ago based on code collected 7 days ago.
 
Posted about 1 month ago by zneic
Hy, thank you very much for your response. Well I have tried your code example and it seems that it colors all the row. So I have done the next modification and it works how I needed to do.
cond.EvaluateFunction = ... [More] delegate(SourceGrid.DataGridColumn column, int gridRow, object itemRow)
{
DataRowView drv = (DataRowView)itemRow;
return drv != null && column.Index >= gv.FixedColumns && (drv.Row[1].ToString() == "SA");
}

Using this it will color just the cells that contain the "SA" string. So next I will change "SA" with some values from another datagridview. Thank you kenji_uno for your support, and have a nice day. [Less]
Posted about 1 month ago by kenji_uno
Hi.

Ok, sorry.

Here it what I've used for our customer:
public class RowStateStyleBuilder {
public static void Apply(DataGridColumn gc) {
SourceGrid.DataGrid gv = gc.Grid;

... [More] {
var viewSel = (SourceGrid.Cells.Views.Cell)gc.DataCell.View.Clone();
viewSel.BackColor = Color.LightCyan;
viewSel.ForeColor = Color.Black;
var cond = new SourceGrid.Conditions.ConditionView(viewSel);
cond.EvaluateFunction = delegate(SourceGrid.DataGridColumn column, int gridRow, object itemRow) {
DataRowView drv = (DataRowView)itemRow;
return drv != null && column.Index >= gv.FixedColumns && 0 != (drv.Row.RowState & (DataRowState.Modified | DataRowState.Added));
};
gc.Conditions.Add(cond);
}

{
var viewDeleted = (SourceGrid.Cells.Views.Cell)gc.DataCell.View.Clone();
viewDeleted.Font = new Font(gv.Font, FontStyle.Strikeout);
var cond = new SourceGrid.Conditions.ConditionView(viewDeleted);
cond.EvaluateFunction = delegate(SourceGrid.DataGridColumn column, int gridRow, object itemRow) {
DataRowView drv = (DataRowView)itemRow;
return drv != null && column.Index >= gv.FixedColumns && 0 != (drv.Row.RowState & (DataRowState.Deleted));
};

gc.Conditions.Add(cond);
}
}
}

It will highlight modified row:

Added/Modified: cyan back ground.

Deleted: striked out font. (however you need to tweak your datagrid to make the deleted rows visible)

Thanks [Less]
Posted about 1 month ago by zneic
Thank you for your response. It seems that you are confusing sourcegrid.datagrid with something else.
I am getting the following error: "Cannot apply indexing with [] to an expression of type 'SourceGrid.DataGrid' ". Can you check if your code is for SourceGrid.DataGrid.
Thank you, and have a nice day.
Posted about 1 month ago by kenji_uno
Here it is:
gv[2, 2].View = new SourceGrid.Cells.Views.Cell();
gv[2, 2].View.ForeColor = Color.Red;
gv[2, 2].Value = "Red!";
Posted about 1 month ago by zneic
Hy, can someone tell me how can I color a cell in a datagrid? ex: I want to color in Red the cell 2,2. Thank you, and have a nice day.
Posted about 1 month ago by dariusdamalakas
You should be able to get to the actual Button instance, and from there you could call button.Enabled = false to disable that.
Posted 2 months ago by micronovo
hi,
I am not found any way do that.But you can create your custom Click Controller,and remove custom Click Controller when the button shouldn't be click.
Posted 2 months ago by lipiau
Hello,

What shall I do when a GDI+ error occurs - the grid ends up showing a big red X on white background - and the application becomes unstable?
The grid is filled with data from a DataReader, each record inserts a new row with new cells.

Many thanks,

Pieter
Posted 2 months ago by MichaelBate
I am using the following code to create a button in a cell:

SourceGrid.Cells.Button btn = new SourceGrid.Cells.Button("Font");

I have not found any way to either disable or hide the button. I have programmed to button ... [More] click even to ignore clicks when the button should be disabled, but I would like the user to see that he/she shouldn't be clicking the button.

There seem to be several types of "Button" in SourceGrid so I want to make clear which one I am using.

Or should I be using a different class to implement a button within a cell?

Thanks in advance,
Michael Bate [Less]
Posted 2 months ago by gte946e
Thanks Micronovo,
That's exactly what I ended up doing. And I captured the selection changed event and adjusted the selected cells with the method you described above.

I appreciate the help! I should have marked this solved.
 

 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.