This question is locked. New answers and comments are not allowed.
Firstly, why can't I post this in the GridView forum?
I have the following:
Set AutoGenerateColumns = false;
Create the column bindings in the data_loading event handler
eg
GridViewDataControl dataControl = (GridViewDataControl)sender;
dataControl.AutoGenerateColumns = false;
dataControl.ShowGroupPanel = false;
GridViewDataColumn column = new GridViewDataColumn();
column.DataMemberBinding = new Binding("ID");
column.Header = "PayPal ID";
column.MaxWidth = 60;
dataControl.Columns.Add(column);
..etc
This is fine and the columns show up as expected.
I also have a handler for RadGridView1_SelectionChanged
I use
var selectedUIRow = RadGridView1.ItemContainerGenerator.ContainerFromItem(dataItem)
as Telerik.Windows.Controls.GridView.GridViewRow;
var firstCell = selectedUIRow.Cells[1] as Telerik.Windows.Controls.GridView.GridViewCell;
to capture the row and get a cell value. (I don't want to couple the row to an entity). This works fine.... Unless I move the scrollbar, then the cell order changes
This can't be right surely?
I have the following:
Set AutoGenerateColumns = false;
Create the column bindings in the data_loading event handler
eg
GridViewDataControl dataControl = (GridViewDataControl)sender;
dataControl.AutoGenerateColumns = false;
dataControl.ShowGroupPanel = false;
GridViewDataColumn column = new GridViewDataColumn();
column.DataMemberBinding = new Binding("ID");
column.Header = "PayPal ID";
column.MaxWidth = 60;
dataControl.Columns.Add(column);
..etc
This is fine and the columns show up as expected.
I also have a handler for RadGridView1_SelectionChanged
I use
var selectedUIRow = RadGridView1.ItemContainerGenerator.ContainerFromItem(dataItem)
as Telerik.Windows.Controls.GridView.GridViewRow;
var firstCell = selectedUIRow.Cells[1] as Telerik.Windows.Controls.GridView.GridViewCell;
to capture the row and get a cell value. (I don't want to couple the row to an entity). This works fine.... Unless I move the scrollbar, then the cell order changes
This can't be right surely?