Hello, I am using 2010 Q2
1)
I want to display amount in Indian format on grid column.
Is it possible to assign directly using inbuilt formatting?
OR
If not we are using below code for Microsoft Datagridview
Now we are just using this on Form Load as shown below(not handling any formatting event)
Form_Load
{
gridview.Columns["Amount"].DefaultCellStyle = DecimalStyleVal ;
}
How to achive this in your grid, by assigning cellstyle only?
This is working perfectly in MS datagridview.
Display Example:
Decimal value = 12345678.95
( required view )
Display in dgv column = 1,23,45,678.95
Or any alternative to display format as shown in example?
2) How can i apply Numberformat to your gridview column in form loading
3) If possible how to apply for Summary also.
4)
I have a grid showing Stock price.
Which is updating every second.
I want to apply conditional formatting on that
1)
I want to display amount in Indian format on grid column.
Is it possible to assign directly using inbuilt formatting?
OR
If not we are using below code for Microsoft Datagridview
NumberFormatInfo RupeeFormat =
new
NumberFormatInfo();
RupeeFormat.NumberGroupSeparator =
","
;
RupeeFormat.NumberGroupSizes =
new
int
[] {3, 2};
//NOTE: default format for decimal type columns
DataGridViewCellStyle DecimalStyleVal = New DataGridViewCellStyle();
DecimalStyleVal.FormatProvider = RupeeFormat;
DecimalStyleVal.Format = ConstantsUtils.PriceFormat;
DecimalStyleVal.NullValue =
"0.00"
;
DecimalStyleVal.Alignment = DataGridViewContentAlignment.MiddleRight;
Now we are just using this on Form Load as shown below(not handling any formatting event)
Form_Load
{
gridview.Columns["Amount"].DefaultCellStyle = DecimalStyleVal ;
}
How to achive this in your grid, by assigning cellstyle only?
This is working perfectly in MS datagridview.
Display Example:
Decimal value = 12345678.95
( required view )
Display in dgv column = 1,23,45,678.95
Or any alternative to display format as shown in example?
2) How can i apply Numberformat to your gridview column in form loading
3) If possible how to apply for Summary also.
4)
I have a grid showing Stock price.
Which is updating every second.
I want to apply conditional formatting on that
ConditionalFormattingObject c1 =
new
ConditionalFormattingObject(
"Grater"
, ConditionTypes.Greater,
"5"
,
""
,
true
);
c1.CellBackColor = Color.LightBlue;
c1.CellForeColor = Color.Black;
ConditionalFormattingObject c2 =
new
ConditionalFormattingObject(
"Less"
, ConditionTypes.Less,
"5"
,
""
,
true
);
c2.CellBackColor = Color.IndianRed;
c2.CellForeColor = Color.Black;
ConditionalFormattingObject c3 =
new
ConditionalFormattingObject(
"Equal"
, ConditionTypes.Equal,
"5"
,
""
,
true
);
c3.CellBackColor = Color.White;
c3.CellForeColor = Color.Black;
I am using above code for generating conditions.
However, here i am having "5" as a Value1 parameter, instead of that i want to check the same cell value with the new value for same cell
Like say, A column BidPrice have value 50 (Old value backcolor = black)
New price after 1 sec is 51 (New value)
so i want to put conditionalformatting in such a way that it should check Old value and New value for setting cell colors for price change display. in this case "c1" will be applied to the cell after new value.
Display should be BidPrice 51 ( backcolor = blue )
Hope you undderstand wat i want to ask.
Thanks,