Home > Net >  Datagridview how to implement according to balance the value of the column to change the display sta
Datagridview how to implement according to balance the value of the column to change the display sta

Time:11-12

Is to balance the column value is higher than 50 state column shows normal, below 50 shows insufficient,
How to do?

CodePudding user response:

Whether the field value is lower than 50! Money<=50?" Insufficient balance ": Money
Consciousness about this! You consider

CodePudding user response:

You can loop in the background to add data, determine the balance of the size of the value, then the state assignment is ok
Grid. Rows [I] cells [r]. "XXXX" value=https://bbs.csdn.net/topics/data

CodePudding user response:

Write a class inherits IValueConverter,
For example:
 
///& lt; Summary>
///date format conversion
///& lt;/summary>
Public class DateTimeConverter: IValueConverter
{
Public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
{
DateTime time=(DateTime) value;
The return time. ToString (" on dd MM yyyy years HH: MM: ss ");
}

Public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
{
String STR=value. The ToString ();
Return a DateTime. ParseExact (STR, "on dd MM yyyy years HH: MM: ss", CultureInfo. InvariantCulture);
}
}

Then XAML page configuration:
 




The rest is your lines,

CodePudding user response:

When traversing find its value in the column? And then as upstairs to write? I don't know where is your point
  •  Tags:  
  • C#
  • Related