PDA

View Full Version : [CLOSED] RowSelectionModel REV 3986



Aurelio
May 04, 2012, 11:27 PM
HI, i have update at the versione 3986, but i have a problem the load the store, the store il load but not show the data:


protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{

StoreContinenti.DataSource = QueryGeografia.CaricaContinenti();//Linq Query
StoreContinenti.DataBind();

Session["EditModeContinente"] = "Read";
}
}




<ext:Panel ID="PanelContinenti" runat="server" Region="West" Width="300" BodyPadding="3"
Layout="FitLayout" Split="true">
<Items>
<ext:GridPanel ID="GridPanelContinenti" runat="server" Title="Continenti"
StoreID="StoreContinenti">
<ColumnModel>
<Columns>
<ext:Column runat="server" ID="ConCod" DataIndex="ConCod" Align="Left" Text="Codice" Width="100" />
<ext:Column runat="server" ID="GruAziDes" DataIndex="ConDes" Align="Left" Flex="1" Text="Continente" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModelContinente" Mode="Single" runat="server">
<Listeners>
<Select Handler="enableButtonRowSelect(record);" />
</Listeners>
</ext:RowSelectionModel>
</SelectionModel>
</ext:GridPanel>
</Items>
</ext:Panel>

If leave the section RowSelectionModel, it's work ok. The data in show in the gridpanel.
the problem seems to be the RowSelectionModel and appear only then the page is not a postback. If call a directmethod that execute a postback then the page is load the data appear.
In all prevoius versione it's work.


Thanks
Aurelio.

Vladimir
May 05, 2012, 4:20 AM
Can you post test sample which we can test on our side?

Aurelio
May 05, 2012, 1:04 PM
Hi, Vladimir...where is the sample:


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="ARWebRevolution.WebForm3" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!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">
<ext:ResourceManager ID="ResourceManager1" runat="server" Namespace="">
</ext:ResourceManager>
<ext:Store ID="StoreContinenti" runat="server">
<Model>
<ext:Model ID="ModelContinenti" runat="server" >
<Fields>
<ext:ModelField Name="ConId" />
<ext:ModelField Name="ConCod" />
<ext:ModelField Name="ConDes" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<div>
<ext:Panel ID="PanelContinenti" runat="server" Region="West" Width="300" BodyPadding="3"
Layout="AutoLayout" Split="true">
<Items>
<ext:GridPanel ID="GridPanelContinenti" runat="server" Title="Continenti"
StoreID="StoreContinenti">
<ColumnModel>
<Columns>
<ext:Column runat="server" ID="ConCod" DataIndex="ConCod" Align="Left" Text="Codice" Width="100" />
<ext:Column runat="server" ID="GruAziDes" DataIndex="ConDes" Align="Left" Flex="1" Text="Continente" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModelContinente" Mode="Single" runat="server">

</ext:RowSelectionModel>
</SelectionModel>
</ext:GridPanel>
<ext:Button ID="Button1" runat="server" Text="Click to Show data at first load of the page">
<DirectEvents>
<Click OnEvent="clickHere" />
</DirectEvents>
</ext:Button>
<ext:TextField ID="TextField1" runat="server">
</ext:TextField>
</Items>
</ext:Panel>
</div>
</form>
</body>
</html>




using System;
using System.Collections.Generic;
using Ext.Net;

namespace ARWebRevolution
{
public partial class WebForm3 : System.Web.UI.Page
{
private IList<Continenti> lstContinenti;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
loadData();
StoreContinenti.DataSource = lstContinenti;
StoreContinenti.DataBind();

}
}

private void loadData()
{
lstContinenti = new List<Continenti>();
lstContinenti.Add(new Continenti{ConId = 1, ConCod = "E", ConDes = "Europa"});
lstContinenti.Add(new Continenti { ConId = 2, ConCod = "A", ConDes = "Asia" });
lstContinenti.Add(new Continenti { ConId = 3, ConCod = "O", ConDes = "Oceania" });
}

public class Continenti
{
public int ConId { get; set; }
public string ConCod { get; set; }
public string ConDes { get; set; }
}

protected void clickHere(object sender, DirectEventArgs e)
{
//Refresh the UI and the show the data then first load of the page
TextField1.Hidden = true;

}

}
}


Then load the page at first time, the data not show in thw grid, but if click the button the textField cause a refresh and the data now appear.

Thanks
Aurelio

Vladimir
May 05, 2012, 2:20 PM
Thank you for the sample, please update from SVN and retest

Aurelio
May 05, 2012, 2:39 PM
HI, Vladimir....okkkk work fine.

Thanks
Aurelio