PDA

View Full Version : [CLOSED] V2.1 GridPanel Column Editor Help



Aurelio
Aug 25, 2012, 4:23 PM
HI, help my to insert a textfied in a editor column server side...thanks..

In the page aspx, insert this and work ok..


<ext:Column ID="ColumnScaPagGio" runat="server"
DataIndex="ScaPagGio"
Text="Giorni" Align="Right"
Width="100">
<Editor>
<ext:NumberField runat="server" MinValue="0" ID="EditGiorni" />
</Editor>
</ext:Column>


But in c# can not configure the editor...where is my code:



StoreArtColTag.AddField(new ModelField("Col" + taglia, ModelFieldType.String));
GridPanelBarCod.ColumnModel.Columns.Add(new Column
{
DataIndex = "Col" + taglia,
Text = taglia,
Width = 120,
EmptyCellText = taglia
});


If you can help...thanks

Aurelio

Aurelio
Aug 25, 2012, 4:34 PM
HI.. i have resolt...grgrg


StoreArtColTag.AddField(new ModelField("Col" + taglia, ModelFieldType.String));
var column = new Column();
column.DataIndex = "Col" + taglia;
column.Text = taglia;
column.Width = 120;
column.EmptyCellText = taglia;
column.Editor.Add(new TextField());
GridPanelBarCod.ColumnModel.Columns.Add(column);


Close the post..and sorry

Thanks
Aurelio

Daniil
Aug 26, 2012, 11:01 AM
Hi,

Please clarify when did you call this code?





StoreArtColTag.AddField(new ModelField("Col" + taglia, ModelFieldType.String));



If during DirectEvent/DirectMethod, it is OK. If during initial page load, then please populate the Fields collection of the Store Model.

Aurelio
Aug 26, 2012, 11:51 AM
HI..Daniil, sorry, call the code in a DirectMethod



[DirectMethod]
public void AddTaglieBarCode(string pTaglie)
{
var taglie = pTaglie.ToString().Split(new char[] {','});

StoreArtColTag.Model.Clear();
GridPanelBarCod.SelectionModel.Clear();
StoreArtColTag.AddField(new ModelField("ColId"));
StoreArtColTag.AddField(new ModelField("ColDes"));

GridPanelBarCod.ColumnModel.Columns.Clear();
GridPanelBarCod.ColumnModel.Columns.Add(new Column { DataIndex = "ColDes", Text = "Colore", Locked=true });


foreach (string taglia in taglie)
{
StoreArtColTag.AddField(new ModelField("Col" + taglia, ModelFieldType.String));
var column = new Column();
column.DataIndex = "Col" + taglia;
column.Text = taglia;
column.Width = 120;
column.EmptyCellText = taglia;
column.Editor.Add(new TextField());

GridPanelBarCod.ColumnModel.Columns.Add(column);
}

GridPanelBarCod.Reconfigure();
}


It's work ok...

Thanks
Aurelio

Daniil
Aug 26, 2012, 3:47 PM
I think you can remove these lines:

StoreArtColTag.Model.Clear();GridPanelBarCod.Selec tionModel.Clear();


since they should not cause any effect during a DirectEvent.

Aurelio
Aug 26, 2012, 10:29 PM
Hi..Daniil..Ok

Thanks
Aurelio