I have a simple grid that is in runtime bound to the DataTable object. (in Page_Load event)
On the server event RowSelectionChanged the e.CurrentSelectedRows[0].DataKey[0] return always null!!
My markup:
<ig:WebDataGrid ID="wdgSearchHistory" runat="server" Height="200px" Width="100%"
AutoGenerateColumns="False"
ShowHeader="False" EnableDataViewState="True" DataKeyFields="searchTime"
OnRowSelectionChanged="wdgSearchHistory_RowSelectionChanged"
EnableAjax="True" EnableViewState="true" >
<Columns>
<ig:BoundDataField DataFieldName="QueryHTML" Key="QueryHTML">
<Header Text="QueryHTML" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="searchTimestr" Hidden="true" Key="searchTimestr">
<Header Text="searchTimestr" />
<ig:BoundDataField DataFieldName="searchTime" Hidden="true" Key="searchTime">
<Header Text="searchTime" />
</Columns>
<Behaviors>
<ig:Activation>
</ig:Activation>
<ig:Selection CellClickAction="Row" RowSelectType="Single">
<AutoPostBackFlags RowSelectionChanged="True" />
</ig:Selection>
</Behaviors>
</ig:WebDataGrid>
So do I. vs2010 and the latest webdatagrid.
Code:Private Sub WebDataGrid1_RowSelectionChanged(sender As Object, e As Infragistics.Web.UI.GridControls.SelectedRowEventArgs) Handles WebDataGrid1.RowSelectionChanged
lbErrorMsge.Text += e.CurrentSelectedRows.Item(0).ToString
Error: NULL reference. Object reference not set to an instance of an object.
Does anyone know how to solve this issue, ie. retrieve the row details from the server side?
Also this procedure only fires when ajax=FALSE in the grid.
Regards,
Graham.
I am having the same issue.
When the Row SelectionChanged event fires on the server side, e.CurrentSelectedRows(0) (the only row I selected) comes back as Nothing.Running webgrid version 10.3.20103.2046.<%@ Register Assembly="Infragistics35.Web.v10.3, Version=10.3.20103.2046, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.GridControls" tagprefix="ig" %>Infragistics 10.3.NET Framework 3.5Visual Studio 2008
NOTE - Row Selection seems to be working properly in version 10.3.20103.1013.
Hi,
I have the same problem. I created a simple grid page (below). Data populated ok but I always got null value on e.CurrentSelectedRows[0]
Client Code:
<%
@ Page Title="" Language="C#" MasterPageFile="~/Demo1/Demo1MasterPage.master" AutoEventWireup="true" CodeFile="GridTest1.aspx.cs" Inherits="Demo1_GridTest1" %>
@ Register Assembly="Infragistics4.Web.v10.2, Version=10.2.20102.1011, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>
<
asp:Content ID="Content5" ContentPlaceHolderID="ContentPlaceHolder_RightPane" Runat="Server">
div class="EstimateSummary">
<ig:WebDataGrid ID="wdgEstimateSummary" runat="server" Height="200px"
Width="750px" DataKeyFields="intTIID" StyleSetName="Windows7"
onrowselectionchanged="wdgEstimateSummary_RowSelectionChanged">
<ig:BoundDataField DataFieldName="chrtradeitem" DataType="System.String"
Key="chrtradeitem" Width="50px">
<Header Text="TI" />
<ig:BoundDataField DataFieldName="TIDesc" DataType="System.String" Key="TIDesc"
Width="200px">
<Header Text="Description" />
<ig:BoundDataField DataFieldName="fltLcost" DataType="System.Double" DataFormatString="{0:N0}"
Key="fltLcost" Width="60px">
<Header Text="Labor" />
<ig:BoundDataField DataFieldName="fltMcost" DataType="System.Double" DataFormatString="{0:N0}"
Key="fltMcost" Width="60px">
<Header Text="Material" />
<ig:BoundDataField DataFieldName="fltEcost" DataType="System.Double" DataFormatString="{0:N0}"
Key="fltEcost" Width="70px">
<Header Text="Equipment" />
<ig:BoundDataField DataFieldName="fltScost" DataType="System.Double" DataFormatString="{0:N0}"
Key="fltScost" Width="60px">
<Header Text="Sub" />
<ig:BoundDataField DataFieldName="TotwMkups" DataType="System.Double" DataFormatString="{0:N0}"
Key="TotwMkups" Width="100px">
<Header Text="Total w/Mkups" />
</
div>
asp:Content>
protected void wdgEstimateSummary_RowSelectionChanged(object sender, Infragistics.Web.UI.GridControls.SelectedRowEventArgs e)
{
int intTI;
if (int.TryParse(e.CurrentSelectedRows[0].DataKey.GetValue(0).ToString(), out intTI))
clsGlobals.TIID = intTI;
}
Please advise - Thanks
Dan
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
Are you still facing this issue? I wasn’t able to replicate it with 10.2.20102.1011. Would you tell me which version are you using?
Lyuba
Developer Support Engineer
Infragistics
www.infragistics.com/support