The column image setting overrides the local image setting.
Work around:
void grid_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement is GridCommandCellElement)
{
if (e.Column.Name == "stationview")
{
RadButtonElement element = (RadButtonElement)e.CellElement.Children[0];
element.UnbindProperty(RadButtonElement.ImageProperty);
element.Image = img;
element.DisplayStyle = DisplayStyle.Image;
element.ImageAlignment = ContentAlignment.MiddleCenter;
}
}
}
The recommended solution works fine but late I found that unfortunately there is some error in handling custom filters that prevents in most of our grids correct functioning.
I enabled custom filtering and assigned event handler. When following conditions are met:
- grid has no FilterDescriptors
- e.Handled is set to false in GridViewCustomFilteringEventHandler
then row, for which was set e.Handler = false in custom filtering event handler, is not shown in the grid. If grid has some FilterDescriptor in its FilterDescriptors collections, then everything works as expected.
If you have the grid bound to a data source and then you assign another data source containing some of the columns that exists in the first one (with the same name), those columns are not shown:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
DataTable table = new DataTable();
table.Columns.Add("col1");
table.Columns.Add("col2");
for (int i = 0; i < 10; i++)
{
table.Rows.Add("A " + i, "B " + i);
}
radGridView1.DataSource = table;
}
private void radButton1_Click(object sender, EventArgs e)
{
DataTable table = new DataTable();
table.Columns.Add("col1");
table.Columns.Add("col2");
table.Columns.Add("col3");
table.Columns.Add("col4");
for (int i = 0; i < 10; i++)
{
table.Rows.Add("Z " + i, "X " + i, "C " + i, "V " + i);
}
//work around
//radGridView1.MasterTemplate.Reset();
radGridView1.DataSource = table;
}
}
1. Create a project with RadGridView. 2. Group by some column. 3. Set the MultiSelect option to true. 4. When handling the CellValueChanged event change the value for all selected rows. 5. Run the project and filter by some column. 6. Select some rows and edit a value of a cell from the filtered column. 7. Repeat the action.
To reproduce: Add radGridView to a form open the property builder add GridViewCommandColumn go to advanced settings click the ellipse button of the Header Image property
Steps to reproduce: 1. Add a grid to a form and populate it with hierarchical data. 2. Add a button and in its click event handler add the following: a. code that will hide all but one row in the the grid master view. b. code that will export the grid via ExportToExcMelML 3. The resulting excel file will not contain the proper data.
The issue appears when there are empty string resources in the application. 1. Create a new project with RadGridView. 2. Add some columns. 3. Add empty string resource in the application resources. 4. Change the TextAlignment property of some column. 5. Check the generated designer code.
1. Create a new project with RadGridView. 2. Add some columns. 3. Set the MinWidth property for the last column to 2000. Do not set its Width property. 4. Run the project.
1. Create a new project with RadGridView. 2. Setup a column groups view. 3. Set the AutoSizeColumnsMode to fill. 4. Set MinWidth for all columns. 5. Run the project and start resizing a column.
create a filter on the "Status" column before clicking Save and Load? Invalid filter expression. ---> Telerik.Data.Expressions.InvalidExpressionException: Cannot perform '=' operation on WindowsFormsApplication1.EmployeeStatus and System.String.
1. Create a new project with RadGridView. 2. Setup a column groups view. 3. Set the AllowHide property for column group columns to true. 4. Run the project. 5. Open a column chooser and hide a column group by drag & drop in column chooser.
To reproduce, add a grid with GridViewHyperlinkColumn and enough rows for vertical scrolling. Click a link in a cell so its link will change to visited (its color changes). Scroll down and you will see how the same visited state is transferred to other cells.
1. Create a new project with RadGridView. 2. Bind it to a data source which contain a date-time column. 3. Enable the filtering and and enable the excel like filtering feature. 4. Run the project and open the filtering popup for the date-time column. You should see a popup with calendar.
There should be an option that allows users to change the column and row delimiters for the ExportToCSV.
Setting the FieldName of a column in the child template to "Products.Name" does not work properly.
I am executing the following code. Utilizing the debugger I know the code is only implemented once, and it works correctly at first but then at seemingly random intervals multiple rows will expand. I used modified code as well to first collapse all rows and then expand only the one with the matching ID field, but I get the same results.
Clearing and refreshing the rows in a data table bound to a RadComboBoxColumn causes problems in the RadGridView. The column's drop-down stops working and in some cases the entire grid has become unresponsive.
IMPROVE. RadExpressionEditorForm - one should be able to access the form and its controls in order to customize their appearance
To reproduce - Have a page view with two pages - one empty and one with a grid - put some cell in the grid in edit mode and cancel its validation in the CellValidating event - at this point you cannot change the current cell in the grid (which is desired) but you are able to switch to another page in the page view, thus its SelectedPageChanging event fires (which is not desired)
FIX. RadGridView - the TextAlignment property of GridViewHyperlinkColumn is not taken into consideration
Reproduce:
- add RadGridView
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'nwindDataSet.Customers' table. You can move, or remove it, as needed.
this.customersTableAdapter.Fill(this.nwindDataSet.Customers);
DataColumn colContactName = nwindDataSet.Customers.Columns["ContactName"];
DataColumn colAddress = nwindDataSet.Customers.Columns["Address"];
this.radGridView1.Columns.Add(colContactName.ColumnName);
this.radGridView1.Columns.Add(colAddress.ColumnName);
this.radGridView1.Columns.Add(new GridViewHyperlinkColumn(colAddress.ColumnName + " Link"));
this.radGridView1.Columns["Address"].TextAlignment = ContentAlignment.MiddleRight;
this.radGridView1.Columns["Address Link"].TextAlignment = ContentAlignment.MiddleRight;// Different alignment between the two columns
foreach (DataRow row in nwindDataSet.Customers.Rows)
{
this.radGridView1.Rows.Add(row.ItemArray[2], row.ItemArray[4], row.ItemArray[4]);
}
}
Workaround:
private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
GridHyperlinkCellElement cell = e.CellElement as GridHyperlinkCellElement;
if (cell != null)
{
cell.ContentElement.TextAlignment = ContentAlignment.MiddleRight;
}
}