Tuesday, December 15, 2009
How To See all Trigger in SQL SERVER
It will show all trigger that is applied on database tables
Friday, December 11, 2009
Criteria /Filtering year, month or day in XAF
SELECT * FROM table WHERE MONTH(date1) = '1'
SELECT * FROM table WHERE DAY(date1) = '20'
There are equivalent Criteria in XAf
The FunctionOperator allows you to use "SQL" functions such as YEAR()
New BinaryOperator(New FunctionOperator(FunctionOperatorType.GetYear, New
OperandProperty("Date1")), New OperandValue(2009), BinaryOperatorType.Equal)
Or
CriteriaOperator.Parse("GetYear(Date1)=2009")
How To Add ListViewFilter From BO Model in XAF
How To Add Conditional Formatting in XAF
How To Add Item in Grid Control Like Button/TextBox in XAF
{
ListView Lv = (ListView)View;
DevExpress.XtraEditors.TextEdit te = new TextEdit();
System.Windows.Forms.ListBox l = new System.Windows.Forms.ListBox();
DropDownButton dp = new DropDownButton();
GridControl gc = (GridControl)Lv.Control;
gc.Controls.Add(te);
gc.Controls.Add(dp);
gc.Controls.Add(l);
foreach (System.Windows.Forms.Control g in gc.Controls)
{
if (g is DevExpress.XtraEditors.TextEdit)
{
DevExpress.XtraEditors.TextEdit te1 = (DevExpress.XtraEditors.TextEdit)g;
te1.Text = "System";
}
}
}
How To Change Case of GridColumn in Upper Case/Cell Content in Upper Case
void View_ControlsCreated(object sender, EventArgs e)
{
if (View is DevExpress.ExpressApp.ListView && View.ObjectTypeInfo.Type == typeof(DomainObject1))
{
DevExpress.ExpressApp.ListView lv = (DevExpress.ExpressApp.ListView)View;
GridControl gd = (GridControl)lv.Control;
GridControl gd1 = new GridControl();
GridView gv = (GridView)gd.FocusedView;
RepositoryItemTextEdit rite = new RepositoryItemTextEdit();
rite.CharacterCasing = CharacterCasing.Upper;
gv.Columns["NameOfPerson"].ColumnEdit = rite;
}
Filter ListView Data Will Not Show on ListView Activated When You Search Record Then Record Will Show in XAF
I want Data Will not Populate in ListView on ListView Activated
Data Will Show when I search any Thing from search Button
protected override void OnActivated()
{
base.OnActivated();
if (View is ListView && View.ObjectTypeInfo.Type == typeof(ContactA))
{
ListView lv = (ListView)View;
lv.CollectionSource.CollectionChanged += new EventHandler(CollectionSource_CollectionChanged);
}
}
void CollectionSource_CollectionChanged(object sender, EventArgs e)
{
ListView listView = (ListView)View ;
if (listView.CollectionSource.Collection.Count > 0)
{
if (!listView.CollectionSource.Criteria.ContainsKey("EmptyCollectionCriteria"))
{
listView.CollectionSource.Criteria.Add("EmptyCollectionCriteria", CollectionSource.EmptyCollectionCriteria);
}
listView.CollectionSource.Criteria.Changed += new EventHandler(Criteria_Changed);
}
}
void Criteria_Changed(object sender, EventArgs e)
{
ListView listView = (ListView)View;
listView.CollectionSource.Criteria.Remove("EmptyCollectionCriteria");
}
How To Apply EditorState on Property in XAF
Assembly : DevExpress.ExpressApp.ConditionalEditorState;
[EditorStateRule("ServiceTaxApp", "IsServiceTaxApplicable", ViewType.DetailView, "")]
public EditorState EditorSTA(out bool active)
{
active = true;
if (AccountGroups != null && StatutoryConfig != null && StatutoryConfig.IsServiceTaxApplicable)
{
active = !(AccountGroups.IsTaxApplicable(SSType.ServiceTax));
}
return EditorState.Hidden;
}
How To Find Object of Maximum Salary in XAF
Here You Can Find Maximum Debit Object
And int maxValue = int.Parse(Session.Evaluate(typeof(class), CriteriaOperator.Parse("Max(salary)")));
int maxValue = int.Parse(Session.Evaluate
Note : Here donot Apply "" in GroupWiseMasterDailyLedger and also one lessthan and greater than Sign
How To Find Top 10 Record in ListView in XAF
{
ListView lv = (ListView)View;
XPCollection XPC =(XPCollection) lv.CollectionSource.Collection;
SortingCollection sc = new SortingCollection(); sc.Add(new SortProperty("Debit", DevExpress.Xpo.DB.SortingDirection.Descending));
XPC.Sorting = sc;
XPC.TopReturnedObjects = 5;
}
How To Add Search Option on Lookup
How To Apply Clock and Date on Your Application
Display Format for Timespan in C#
EditMask {0:HH:mm}
EditMask HH:mm
Set the mask so the user can enter a phone number, with optional area code, and a state in capitals.this.c1TrueDBGrid.Columns[0].EditMask = "(###) 000-0000 St\ate\: >LL";
$#,##0.00;($#,##0.00) Currency format.
0 Fixed number format.
#,##0 Commas format.
0% Percent format.
0.00E+00 Scientific format.
c General Date and Time format.
dddddd Long Date format.
dd-mmm-yy Medium Date format.
ddddd Short Date format.
ttttt Long Time format.
hh:mm AM/PM Medium Time format.
How To Change Grid into VerticalGrid
:DevExpress.XtraGrid;
void View_ControlsCreated(object sender, EventArgs e)
{
ListView LV=(ListView)View;
GridControl GD = (GridControl)LV.Editor.Control;
VGridControl VG = new VGridControl(); VG.DataSource = LV.CollectionSource.Collection;
GD.Controls.Add (VG);
VG.AllowDrop = true;
VG.Dock = System.Windows.Forms.DockStyle.Fill;
VG.Appearance.FocusedRow.BackColor = System.Drawing.Color.Red;
VG.AllowDrop = true;
VG.LayoutStyle = LayoutViewStyle.MultiRecordView;
System.Drawing.Size sz = new System.Drawing.Size(1500, 1500);
VG.Size = sz;
VG.OptionsBehavior.AutoFocusNewRecord = true;
VG.OptionsBehavior.Editable = true;
VG.OptionsBehavior.RecordsMouseWheel = true;
VG.OptionsView.AutoScaleBands = true;
VG.OptionsView.ShowButtons = true;
}
How to Check That Interface is implemented in the Class
Open Popup ListView of any Class on Navigation Click
To do this you have to write a Controller and
inherit it with ShowNavigationItemController
Here There is a Class Shipment when I click on Shipment in NavigationBar then a
PopupListView will Come of DispatchRegister
Now add the code below
protected override void ShowNavigationItem(SingleChoiceActionExecuteEventArgs args)
{
base.ShowNavigationItem(args);
if ((args.SelectedChoiceActionItem != null) && args.SelectedChoiceActionItem.Enabled)
{
if (args.SelectedChoiceActionItem.Id == "Shipment_ListView")
{
ObjectSpace os = Application.CreateObjectSpace();
DevExpress.ExpressApp.ListView lv = Application.CreateListView(os, typeof(DispatchRegister), true);
args.ShowViewParameters.CreatedView = lv;
args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
args.ShowViewParameters.CreateAllControllers = true;
DialogController dc = new DialogController();
args.ShowViewParameters.Controllers.Add(dc);
dc.Accepting += new EventHandler
}
}
}
Now Write Code on Accepting Here You Can Find Selected Item after Clicking on OK Button
void dc_Accepting(object sender, DialogControllerAcceptingEventArgs e)
{
ObjectSpace os=Application.CreateObjectSpace ();
ListView lv = ((ListView)((WindowController)sender).Window.View);
Shipment sp = null;
CollectionSource cs = new CollectionSource(os, typeof(Shipment));
CollectionSourceBase cs1 = (CollectionSourceBase)lv.CollectionSource;
foreach (DispatchRegister dr in lv.SelectedObjects)
{
sp = new Shipment(os.Session);
sp.BlockNo = dr.DeliveryNumber;
sp.ChallanNo = dr.DistributionChannel;
cs.Collection.Add(os.GetObject (sp));
}
ListView listView = Application.CreateListView("Shipment_ListView", cs, true);
e.ShowViewParameters.CreatedView = listView;
e.ShowViewParameters.TargetWindow = TargetWindow.Default;
}
Mat Table Angular
Mat Table in Angular Mat table is used to display data . its a material designed styled data-table . For using Material Table MatTableMo...
-
CriteriaOperator criteria = new BinaryOperator("Age", 30, BinaryOperatorType.Greater); CriteriaOperator criteria = CriteriaOperato...
-
SortingCollection sc = new SortingCollection(); sc.Add (new SortProperty("field on which you want to sort",DevExpress.Xpo.DB.Sorti...
-
Here ItemName will be Enable/Disable According to IsApplicable Property Assembly: DevExpress.XtraLayout; DevExpress.ExpressApp.Win.Layou...