or
<
telerik:RadChart
ID
=
"RC_Line1"
runat
=
"server"
DataSourceID
=
"SDS_Chart_Line1"
DefaultType
=
"Line"
Skin
=
"Office2007"
AutoLayout
=
"True"
SeriesPalette
=
"Pal1"
Height
=
"600px"
Width
=
"800px"
IntelligentLabelsEnabled
=
"True"
>
<
CustomPalettes
>
<
telerik:Palette
Name
=
"Pal1"
>
<
Items
>
<
telerik:PaletteItem
MainColor
=
"Yellow"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"Blue"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"Red"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"Orange"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"Green"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"Cyan"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"Magenta"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"Gray"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"FloralWhite"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
<
telerik:PaletteItem
MainColor
=
"Turquoise"
SecondColor
=
"Black"
></
telerik:PaletteItem
>
</
Items
>
</
telerik:Palette
>
</
CustomPalettes
>
<
Appearance
Border-Visible
=
"False"
></
Appearance
>
<
ChartTitle
>
<
Appearance
>
<
FillStyle
MainColor
=
""
></
FillStyle
>
</
Appearance
>
<
TextBlock
Text
=
"Pappas AUT"
>
<
Appearance
TextProperties-Font
=
"Arial, 18px"
TextProperties-Color
=
"Black"
></
Appearance
>
</
TextBlock
>
</
ChartTitle
>
<
Legend
>
<
Appearance
Position-AlignedPosition
=
"Right"
>
<
ItemTextAppearance
TextProperties-Color
=
"Black"
></
ItemTextAppearance
>
<
ItemMarkerAppearance
Figure
=
"Square"
></
ItemMarkerAppearance
>
<
Border
Visible
=
"False"
/>
</
Appearance
>
</
Legend
>
<
PlotArea
>
<
XAxis
DataLabelsColumn
=
"Year"
LayoutMode
=
"Normal"
></
XAxis
>
<
YAxis
><
Appearance
MinorGridLines-Visible
=
"False"
></
Appearance
></
YAxis
>
</
PlotArea
>
</
telerik:RadChart
>
div>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
GridLines
=
"None"
AllowPaging
=
"True"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
ViewStateMode
=
"Disabled"
Width
=
"97%"
enableajax
=
"True"
CssClass
=
"productsGrid"
CellSpacing
=
"0"
AllowFilteringByColumn
=
"True"
ShowFooter
=
"True"
Skin
=
"Black"
AllowMultiRowSelection
=
"True"
OnItemCommand
=
"RadGrid1_ItemCommand"
OnGridExporting
=
"RadGrid1_GridExporting"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
<
ClientSettings
AllowColumnsReorder
=
"True"
ReorderColumnsOnClient
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
/>
</
ClientSettings
>
<
MasterTableView
GridLines
=
"None"
Width
=
"100%"
ViewStateMode
=
"Disabled"
CommandItemSettings-ShowExportToCsvButton
=
"True"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
CommandItemDisplay
=
"Top"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"SequencialNumber"
HeaderText
=
"SequencialNumber"
UniqueName
=
"SequencialNumber"
SortExpression
=
"SequencialNumber"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Priorities.Priority"
HeaderText
=
"Priority"
UniqueName
=
"Priority"
FilterControlAltText
=
"Filter Priority column"
SortExpression
=
"Priority"
DataType
=
"System.Int32"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Staging.Process"
HeaderText
=
"Staging"
UniqueName
=
"Process"
SortExpression
=
"Process"
FilterControlAltText
=
"Filter Process column"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SupplierCode"
HeaderText
=
"SupplierCode"
UniqueName
=
"SupplierCode"
SortExpression
=
"SupplierCode"
FilterControlAltText
=
"Filter SupplierCode column"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"MessageStatus"
HeaderText
=
"MessageStatus"
UniqueName
=
"MessageStatus"
SortExpression
=
"MessageStatus"
FilterControlAltText
=
"Filter MessageStatus column"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DocumentType"
HeaderText
=
"DocumentType"
UniqueName
=
"DocumentType"
FilterControlAltText
=
"Filter DocumentType column"
SortExpression
=
"DocumentType"
>
</
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
UniqueName
=
"InvoiceCreationDate"
DataField
=
"InvoiceCreationDate"
HeaderText
=
"InvoiceCreationDate"
FilterControlAltText
=
"Filter InvoiceCreationDate column"
SortExpression
=
"InvoiceCreationDate"
>
<
FilterTemplate
>
<
telerik:RadDatePicker
ID
=
"RadDatePicker1"
runat
=
"server"
>
</
telerik:RadDatePicker
>
</
FilterTemplate
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridBoundColumn
DataField
=
"SupplierVatNumber"
FilterControlAltText
=
"Filter SupplierVatNumber column"
HeaderText
=
"SupplierVatNumber"
SortExpression
=
"SupplierVatNumber"
UniqueName
=
"SupplierVatNumber"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
ExpandCollapseColumn
Visible
=
"False"
>
<
HeaderStyle
Width
=
"19px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
RowIndicatorColumn
Visible
=
"False"
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
public partial class InvoicesScalingDefault : Microsoft.Practices.CompositeWeb.Web.UI.Page, IInvoicesScale
{
private InvoicesScalePresenter _presenter;
public System.Collections.Generic.IList<
Data.SapDocuments
> SapDocuments
{
get;
set;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this._presenter.OnViewInitialized();
}
this._presenter.OnViewLoaded();
//string userLogin = Page.User.Identity.Name;
}
[CreateNew]
public InvoicesScalePresenter Presenter
{
set
{
this._presenter = value;
this._presenter.View = this;
}
}
private void LoadData()
{
//Popular dados na Radlist
SapDocumentsBO sapDocs = new SapDocumentsBO();
string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
if ((user == "xxx") || (user == "xxx"))
{
this.SapDocuments = sapDocs.GetSapDocuments();
RadGrid1.DataSource = this.SapDocuments;
}
else
{
this.SapDocuments = sapDocs.GetSapDocumentsByUser(user);
RadGrid1.DataSource = this.SapDocuments;
}
}
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
LoadData();
}
/// <
summary
>
/// Export de todos os SequencialNumber da tabela para .csv
/// </
summary
>
/// <
param
name
=
"sender"
></
param
>
/// <
param
name
=
"e"
></
param
>
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
{
RadGrid1.MasterTableView.Columns.FindByUniqueName("SequencialNumber").Visible = true;
RadGrid1.ExportSettings.IgnorePaging = true;
int count = 0;
foreach (GridColumn column in RadGrid1.Columns)
{
if (column.Visible)
{
if (count > 0)
column.Visible = false;
else
count++;
}
}
}
}
/// <
summary
>
/// Método para formatar o sequencialNumber
/// </
summary
>
/// <
param
name
=
"sender"
></
param
>
/// <
param
name
=
"e"
></
param
>
protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
{
e.ExportOutput = e.ExportOutput.Replace("\"\r\n\"", "\"\r\n\"'");
}
}
}
<telerik:RadButton ID="myRadButton" runat="server" Text="" CssClass="RadBtn" onclick="some_function"> <Icon SecondaryIconCssClass="rbAdd" SecondaryIconRight="4" SecondaryIconTop="4"/> </telerik:RadButton>when I click on my radbutton "some_function" is fire, but when I click on the icon which is on this button my function doesn't work.
public partial class AssignInvoices : Microsoft.Practices.CompositeWeb.Web.UI.Page, IAssignInvoicesView
{
private AssignInvoicesPresenter _presenter;
//implemantaçao da propriedade
public System.Collections.Generic.IList<
Data.Users
> Users
{
get;
set;
}
public System.Collections.Generic.IList<
Data.Priorities
> Priorities
{
get;
set;
}
public System.Collections.Generic.IList<
Data.Staging
> Staging
{
get;
set;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this._presenter.OnViewInitialized();
}
this._presenter.OnViewLoaded();
Info x = new Info("xx", "xx", "xx,DC=xx,DC=xx");
Dictionary<
string
, string> networkUser = new Dictionary<
string
, string>();
networkUser = x.GetHierarchyTree("xx");
Dictionary<
string
, string> aux = new Dictionary<
string
, string>();
foreach (KeyValuePair<
string
, string> kvp in networkUser)
{
//kvp.Key = user de rede
string userCompName = x.GetUserInfo("cn", kvp.Key);
aux.Add(kvp.Key, userCompName);//Dictionary com key = user de rede e Value = nomeCompleto Utilizador
}
RadListBox1.DataTextField = "Key";
RadListBox1.DataValueField = "Value";
RadListBox1.DataSource = aux;
RadListBox1.DataBind();
//Page.User.Identity.Name para ir buscar o login user
//Popular dados na listbox users
//RadListBox1.DataSource = this.Users;
//RadListBox1.DataTextField = "UserName";
//RadListBox1.DataValueField = "UserSap";
//RadListBox1.DataBind();
//Popular dados na listbox grupos
RadListBox2.DataSource = this.Priorities;
RadListBox2.DataTextField = "Priority";
RadListBox2.DataValueField = "Priority";
RadListBox2.DataBind();
//Popular dados na listbox stagins
RadListBox3.DataSource = this.Staging;
RadListBox3.DataTextField = "Process";
RadListBox3.DataValueField = "Process";
RadListBox3.DataBind();
}
[CreateNew]
public AssignInvoicesPresenter Presenter
{
get
{
return this._presenter;
}
set
{
if (value == null)
throw new ArgumentNullException("value");
this._presenter = value;
this._presenter.View = this;
}
}
// TODO: Forward events to the presenter and show state to the user.
// For examples of this, see the View-Presenter (with Application Controller) QuickStart:
//
protected void RadButton1_Click(object sender, EventArgs e)
{
string _UserValue = RadListBox1.SelectedItem.Value; //Gets the value of item in Users.
//string _text = RadListBox1.SelectedItem.Text; //Gets the Text of items in the list.
List<
string
> _groups = new List<
string
>(); //create a list to store selected groups
string _stg = RadListBox3.SelectedItem.Value; // create a list to store selected stagings
if (RadListBox1.SelectedIndex > -1 && RadListBox2.SelectedIndex > -1 && RadListBox3.SelectedIndex > -1)
{
iConnect.InvoicesScaling.Data.UsersAssignDAO usrAssgnDAO = new iConnect.InvoicesScaling.Data.UsersAssignDAO(new EscalonamentoFacturasEntities());
UsersAssign user = new UsersAssign();
foreach (var grp in RadListBox2.SelectedItems)
{
_groups.Add(grp.Value); //store the selectItems on RadListBox2 to list groups
//efectuar aqui o insert
user.InserDate = DateTime.Now;
int j;
Int32.TryParse(grp.Value, out j);
user.UserName = _UserValue;
user.Priority = j;
user.Staging = _stg;
//passar o objecto a inserir na tabela da bd
usrAssgnDAO.Add(user);
usrAssgnDAO.SaveChanges();
}
}
//else if(RadListBox2.SelectedIndex < -1 )
//reportar erro
}
}
}
RadGrid1.DataSource = this.SapDocuments;
RadGrid1.
RadGrid1.UniqueID.Equals("Process") =
public List<
SapDocuments
> GetSapDocumentsByUser(string userName)
{
var documentsQuery = from sd in spDocs.SapDocuments
join ua in spDocs.UsersAssign
on new { sd.Staging.Process, sd.Priorities.Priority }
equals
new { ua.Process, ua.Priority }
where ua.UserName == userName
//ALterar User
select sd;
return documentsQuery.ToList();
}
}
}
<
MasterTableView
GridLines
=
"None"
Width
=
"100%"
ViewStateMode
=
"Disabled"
CommandItemSettings-ShowExportToCsvButton
=
"True"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
CommandItemDisplay
=
"Top"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"SequencialNumber"
HeaderText
=
"SequencialNumber"
UniqueName
=
"SequencialNumber"
SortExpression
=
"SequencialNumber"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Priority"
HeaderText
=
"Priority"
UniqueName
=
"Priority"
FilterControlAltText
=
"Filter Priority column"
SortExpression
=
"Priority"
DataType
=
"System.Int32"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Process"
HeaderText
=
"Staging"
UniqueName
=
"Process"
SortExpression
=
"Process"
FilterControlAltText
=
"Filter Process column"
>
</
telerik:GridBoundColumn
>
SapDocuments.Staging.Process;
SapDocuments.Priorities.Priority;
I needed to change my datamodel and know i have the exception for Priority and Process :
{"The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."}
I have already set LazyLoad enabled...