I create a DataTable in code with a single text column, I populate it with data. I assign the table to be the DataSource of a WebDataGrid and it displays OK. On the grid I have row selection enabled, CellClickAction=Row, RowSelectType=Single and AutoPostBack for RowSelectionChanged=True.
When selecting rows the event fires correctly and posts back to the server but the underlying grid is set to null:
This crashes on the second row with a null value for SelectedRow but e.CurrentSelectedRows.Count is 1.
I has similar code that used to work in 2010.3. Am I doing something wrong or is this a bug in 2011.1?
Kind regards
Paul
ASP.NET CLR 4.0 VS 2010 2011.1
Hello PedroA,
Did you set the AutoPostbackFlags on selection changed for the grid?
If you do not try to set them like this:
<ig:Selection CellClickAction="Row" RowSelectType="Single"> <AutoPostBackFlags RowSelectionChanged="True" /> </ig:Selection>
<ig:Selection CellClickAction="Row" RowSelectType="Single">
<AutoPostBackFlags RowSelectionChanged="True" />
</ig:Selection>
And test this behavior again.
I think I'm experiencing the same problem...
I have the following code, that fires correctly when a row is selected, where I'm trying to access the selected row collection through different methods:
protected void Grid_RowSelectionChanged(object sender, SelectedRowEventArgs e){ SelectedRowCollection selectedRowsCollection01 = e.CurrentSelectedRows; SelectedRowCollection selectedRowsCollection02 = this.Grid.Behaviors.Selection.SelectedRows; if (selectedRowsCollection01.Count > 0) { GridRecord selectedRow01 = selectedRowsCollection01[0]; } if (selectedRowsCollection02.Count > 0) { GridRecord selectedRow02 = selectedRowsCollection02[0]; }
Both selectedRowsCollection01.Count and selectedRowsCollection02.Count are equal to 1, but selectedRow01 and selectedRow02 are always null.
The WebDataGrid is defined like this:
<ig:WebDataGridID="Grid" DataKeyFields="Id" runat="server" Width="100%" Height="470px"AutoGenerateColumns="False" OnColumnSorted="Grid_SortColumn"EnableTheming="true" OnRowSelectionChanged="Grid_RowSelectionChanged"> <Columns> [blablablablabla] </Columns></ig:WebDataGrid>
I'm using Infragistics4.Web.v11.1, version 11.1.20111.1006.
So, is there something I'm doing wrong or is there a problem accessing the rows?
Thanks!
I am having the same problem. Did you ever find a solution?
Hello Paul,
Let me know if you have further questions.
Hi Paul,
I have just tried making a website to reproduce this and was unable to build 11.1.20111.1012. I do give you kudos for upgrading to 11.1 so quickly. I would love to hear what you have to say about the new column types for the WDG. As for this unfortunate problem. Could you attach a small sample reproducing it for me to look at? Thanks!
regards,
David Young