Hi ! I spent all this afternoon on a problem without findind a solution :(
I added an ASP.NET AJAX Q3 2009 Radgrid :
In code behind I added that :
in order to do something on row selected...
Here is the definition of RowSelected funtion :
And in code behind :
When I debug with IE, it tells me that "window[...]" is null.
How can it be ?? :(
Can you help me please ?
I added an ASP.NET AJAX Q3 2009 Radgrid :
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AutoGenerateColumns="False" |
Skin="WebBlue" AllowSorting="True" AllowPaging="True" OnNeedDataSource="RadGrid1_NeedDataSource" |
OnItemCreated="RadGrid1_ItemCreated" |
EnableAJAX="True" OnItemCommand="RadGrid1_ItemCommand" OnItemEvent="RadGrid1_ItemEvent"> |
<SortingSettings SortedAscToolTip="Tri croissant" SortedDescToolTip="Tri décroissant" |
SortToolTip="Trier" /> |
<MasterTableView> |
<RowIndicatorColumn Visible="False"> |
<HeaderStyle Width="20px" /> |
</RowIndicatorColumn> |
<ExpandCollapseColumn Resizable="False" Visible="False"> |
<HeaderStyle Width="20px" /> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridBoundColumn DataField="Cli" meta:resourcekey="CliColumnResource" UniqueName="Cli"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="ACId" meta:resourcekey="ACIdColumnResource" UniqueName="ACId"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="ArchiveId" meta:resourcekey="ArchiveIdColumnResource" UniqueName="ArchiveId"> |
</telerik:GridBoundColumn> |
</Columns> |
</MasterTableView> |
<ClientSettings> |
<Selecting AllowRowSelect="True" /> |
</ClientSettings> |
<SelectedItemStyle BackColor="Blue" ForeColor="White" /> |
</telerik:RadGrid> |
In code behind I added that :
RadGrid1.MasterTableView.ClientDataKeyNames = new string[] { "ArchiveId", "ACId" }; |
this.RadGrid1.ClientSettings.ClientEvents.OnRowSelected = "RowSelected"; |
in order to do something on row selected...
Here is the definition of RowSelected funtion :
<script type="text/javascript"> |
function RowSelected(sender, eventArgs) { |
var archiveId = eventArgs.getDataKeyValue("ArchiveId"); |
var archiveClassId = eventArgs.getDataKeyValue("ACId"); |
window["RadGrid1.ClientID"].AjaxRequest("RadGrid1.UniqueID", "RadGrid1_RowSelected"); |
} |
</script> |
And in code behind :
protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument) |
{ |
base.RaisePostBackEvent(sourceControl, eventArgument); |
if (eventArgument == null) |
return; |
if (eventArgument.Trim() == "") |
return; |
string[] parts = eventArgument.Split(':'); |
switch (parts[0]) |
{ |
case "RadGrid1_RowSelected": |
string[] subparts = parts[2].Split('¤'); |
TbxArchiveId.Text = subparts[1]; |
TbxCAId.Text = subparts[0]; |
break; |
} |
} |
When I debug with IE, it tells me that "window[...]" is null.
How can it be ?? :(
Can you help me please ?