问一个Ext中的GridPanel问题
现在Ext下定义一个GridPanel:<ext:GridPanelID="GridPanel2"runat="server"StoreID="Store1"Height...
现在Ext下定义一个GridPanel:
<ext:GridPanel ID ="GridPanel2" runat ="server" StoreID ="Store1" Height ="600">
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:Column Header="代码" DataIndex="PbtCd" Hidden = "true">
</ext:Column>
<ext:Column Header="名称" DataIndex="PbtNm" Width ="300" />
</Columns>
</ColumnModel>
</ext:GridPanel>
其对应的数据源:
<ext:Store ID="Store1" runat="server" >
<Reader>
<ext:JsonReader IDProperty="PbtCd">
<Fields>
<ext:RecordField Name="PbtCd" />
<ext:RecordField Name="PbtNm" />
<ext:RecordField Name="PbtOpenFg" />
<ext:RecordField Name="Inputer" />
<ext:RecordField Name="PbtSerialNo" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
后台绑定数据源:
private void BindData(bool refresh)//数据源绑定
{
if (refresh || uptpublictypeList == null)
uptpublictypeList = UptPublicTypeList.GetAll();
Store1.DataSource = uptpublictypeList;
Store1.DataBind();
}
初始化加载:
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
BindData(false);
}
}
现在的问题是要在初始化加载的时候做到GridPanel2的第一行是默认被选中的,该怎么做?多谢 展开
<ext:GridPanel ID ="GridPanel2" runat ="server" StoreID ="Store1" Height ="600">
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:Column Header="代码" DataIndex="PbtCd" Hidden = "true">
</ext:Column>
<ext:Column Header="名称" DataIndex="PbtNm" Width ="300" />
</Columns>
</ColumnModel>
</ext:GridPanel>
其对应的数据源:
<ext:Store ID="Store1" runat="server" >
<Reader>
<ext:JsonReader IDProperty="PbtCd">
<Fields>
<ext:RecordField Name="PbtCd" />
<ext:RecordField Name="PbtNm" />
<ext:RecordField Name="PbtOpenFg" />
<ext:RecordField Name="Inputer" />
<ext:RecordField Name="PbtSerialNo" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
后台绑定数据源:
private void BindData(bool refresh)//数据源绑定
{
if (refresh || uptpublictypeList == null)
uptpublictypeList = UptPublicTypeList.GetAll();
Store1.DataSource = uptpublictypeList;
Store1.DataBind();
}
初始化加载:
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
BindData(false);
}
}
现在的问题是要在初始化加载的时候做到GridPanel2的第一行是默认被选中的,该怎么做?多谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询