Replies
I am going to ask that someone who is able to reproduce this issue submit an issue to Developer Support so that the issue can be tracked down. Please include a sample project that shows this issue.
I tried this from the code posted in the forum and could not reproduce this behavior.
I tried out similar code in a quick sample
<%@ Register Assembly="Infragistics35.Web.v8.3, Version=8.3.20083.1, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Behaviors>
<ig:Selection CellClickAction="Row" RowSelectType="Multiple">
</ig:Selection>
</Behaviors>
<Columns>
<ig:BoundDataField DataFieldName="CustomerID" Key="CustomerID">
<Header Text="CustomerID" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="CompanyName" Key="CompanyName">
<Header Text="CompanyName" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="ContactName" Key="ContactName">
<Header Text="ContactName" />
</ig:BoundDataField>
</Columns>
</ig:WebDataGrid>
<asp:Button runat=server onclick="Unnamed1_Click" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NORTHWNDConnectionString %>"
SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName] FROM [Customers]"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
With the following code behind in the button click
protected void Unnamed1_Click(object sender, EventArgs e)
{
foreach (GridRecord row in this.WebDataGrid1.Behaviors.Selection.SelectedRows)
{
if (row != null)
{
}
}
}
and the row was != null in my tests. Could you try a really small sample and see if it works for you?
The DataKeyField off the Band takes a string of column names, comma delimited.
.DataKeyField = "OrderID, ProductID";
I guess you could try clearing the SortedColumns collection (I thought that would clear with the null databind).
If that doesn't work, your best bet is to contact Developer Support, preferably with a sample that can reproduce the issue.
I assume you are using the latest hotfix, there was an old issue that seemed related but its quite old and was resolved some time ago.
One thing that might help would be set the DataSource = null (nothing in VB), calling DataBind() and then binding the new datasource. But without being able to see what might be causing the issue, thats about all I can suggest.