问题
I need to setup each row in an ext.NET GridPanel in the OnDataBinding
event. How can I get the current data item at server side?
<uc:GridPanel ID="egrBills" runat="server" Border="false" Layout="Fit">
<Store>
<ext:Store runat="server" OnDataBinding="OnDataBinding_EventHandler" ID="MainStore">
<!-- ............ -->
protected void OnDataBinding_EventHandler(object sender, EventArgs e)
{
//How do I get current data item?
}
回答1:
With Ext.NET, there is no server-side row databinding event. The client-side <Renderer>
functionality may be an option.
回答2:
DataRowView dr = (DataRowView)e.Item.DataItem;
string CollegeName= Convert.ToString(dr["CollegeName"]);
Here the CollegeName is the name of the column it will give the value at per row on the OnDataBinding event
来源:https://stackoverflow.com/questions/6979263/get-the-current-data-item-row-on-databinding-an-ext-net-gridpanel