Hi.
I get problems with conditional formatting.
In the case that you want to set font color (CellForeColor) that depending on the column condition and you set property ‘Apply to row’ is true and also if you create second condition that changing row back color you will lose CellForeColor setup from first condition.
Is it possible to change dynamically “row back color” without using conditional formatting?
private void WebHRSnifferForm_Load(object sender, EventArgs e)
{
dataBind104ComSettingGrid();
}
private void dataBind104ComSettingGrid()
{
// QueryStringParams is type of KeyValueConfigurationCollection
Grid104CompSetting.DataSource = webHRConfig.OneZeroFour.Company.QueryStringParams.GetEnumerator();
}
But it seems the girdview cannot locate the properties exposed by KeyValueConfigurationElement that is contained within KeyValueConfigurationCollection. So no columns are created.
Is there anything I should implement to let gridview bind to KeyValueConfigurationCollection.
Thanks a lot.
Ricky.
| The following exception occurred in the RadGridView: |
| System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. |
| Parameter name: index |
| at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) |
| at System.ThrowHelper.ThrowArgumentOutOfRangeException() |
| at System.Collections.Generic.List`1.System.Collections.IList.get_Item(Int32 index) |
| at Telerik.WinControls.UI.GridViewData.GetValue(Int32 boundColumnIndex, Int32 columnIndex, Int32 rowIndex) |
| ' in form load, the grid is bound to the genericList |
| private sub frm_frmLoad() |
| Me.radGridView.DataSource = genericList |
| End Sub |
| public sub RemoveItemFromList(ByVal customItemToRemove as CustomItems) |
| ' remove item from the List(Of CustomItems) |
| If genericList.Contains(customItemToRemove) Then |
| genericList.RemoveAt(genericList.IndexOf(customItemToRemove)) |
| End If |
| ' rebind to |
| Me.radGridView.DataSource = genericList |
| End Sub |